-
Notifications
You must be signed in to change notification settings - Fork 1
Alert service
einarhuseby edited this page Feb 28, 2019
·
2 revisions
import { NlfAlertService } from 'app/services/alert/alert.service';
constructor(private alertService: NlfAlertService) {}
private someMethod() {
try {
let param = 1/0;
} catch (e) {
const message = (<Exception>e).Message;
this.alertService.error('Error message: ' + message);
}
}
All bootstrap alerts are available: success, info, primary, secondary, light, dark, warning and error as alias for danger.
All methods accept the following parameters:
message: string, keepAfterNavigationChange = false, dismissible = true, timeout = 0