ng2-alert-center
Version:
Alert center provides an alert service and an alert component, you can include in your Angular 2 project.
26 lines • 1.09 kB
JavaScript
var Alert = (function () {
function Alert(alertType, text, textStrong, autoDismissTime, dismissable) {
if (textStrong === void 0) { textStrong = ''; }
if (autoDismissTime === void 0) { autoDismissTime = 0; }
if (dismissable === void 0) { dismissable = true; }
this.alertType = alertType;
this.text = text;
this.textStrong = textStrong;
this.autoDismissTime = autoDismissTime;
this.dismissable = dismissable;
}
Alert.create = function (alertType, text, autoDismissTime, dismissable) {
if (autoDismissTime === void 0) { autoDismissTime = 0; }
if (dismissable === void 0) { dismissable = true; }
return new Alert(alertType, text, '', autoDismissTime, dismissable);
};
Alert.prototype.isDismissable = function () {
return this.autoDismissTime === 0 || this.dismissable; // avoid sticking alerts
};
Alert.prototype.isAutoDismissing = function () {
return this.autoDismissTime > 0;
};
return Alert;
}());
export { Alert };
//# sourceMappingURL=alert.js.map