npm.io
1.0.4 • Published 4 years ago

@lhn/mat-alert

Licence
MIT
Version
1.0.4
Deps
1
Size
49 kB
Vulns
0
Weekly
0

@lhn/mat-alert

NPM

GitHub tag (latest by date) npm NPM Codacy Badge

Dependencies

  • @angular/core@>=6.0.0
  • @angular/common@>=6.0.0
  • @angular/material@>=6.0.0

Usage

Add MatAlertModule to the imports section of the NgModule you want to use:

import { MatAlertModule } from '@lhn/mat-alert';
 
@NgModule({
 // ...
 imports: [
   // ...
   MatAlertModule,
 ]
})

Inject the service into the component:

import { MatAlert } from '@lhn/mat-alert';
 
@Component({
  // ...
})
export class AppComponent {
  constructor(private alert: MatAlert) {}
  // ..

  public showAlert() {
    this.alert.show('Message title', 'Message content (<em>supports HMTL</em>)', {
      buttonText: 'Great!',
      buttonTheme: 'accent',
      raisedButton: true,
    });
  }
}

Keywords