Alert service - luftsport/nlf-client GitHub Wiki
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