import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], }) export class AppComponent { private readonly _alerts: ReadonlyArray = [ { type: 'info', icon: 'status-information-filled', description: 'This is an example of an info alert message with a link.', }, { type: 'error', icon: 'status-error-filled', description: 'This is an example of an error alert message with a link.', }, { type: 'success', icon: 'status-approved-filled', description: 'This is an example of a success alert message with a link.', }, { type: 'warning', icon: 'status-warning-filled', description: 'This is an example of a warning alert message with a link.', }, { type: 'dark', icon: 'status-information-filled', description: 'This is an example of a dark alert message with a link.', }, ]; alerts: AlertExample[] = [...this._alerts]; remove(alert: AlertExample): void { this.alerts = this.alerts.filter(_alert => _alert !== alert); } reset(): void { this.alerts = [...this._alerts]; } } export interface AlertExample { type: string; icon: string; description: string; }