@lhn/mat-alert
v1.0.4
Published
Implementation of MatDialog shown as an alert message
Downloads
199
Maintainers
Readme
@lhn/mat-alert
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,
});
}
}