@lhn/mat-alert
Version:
Implementation of MatDialog shown as an alert message
53 lines (40 loc) • 1.39 kB
Markdown
# @lhn/mat-alert
[](https://nodei.co/npm/@lhn/mat-alert/)



[](https://www.codacy.com/manual/lhn/mat-alert?utm_source=github.com&utm_medium=referral&utm_content=leandro-hermes/mat-alert&utm_campaign=Badge_Grade)
## 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:
```typescript
import { MatAlertModule } from '@lhn/mat-alert';
@NgModule({
// ...
imports: [
// ...
MatAlertModule,
]
})
```
Inject the service into the component:
```typescript
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,
});
}
}
```