bitcitawebfrontlib-ibsalut
Version:
Angular CLI project used by other Angular projects in the bitcita web project.<br />
49 lines • 2.79 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var message_service_1 = require("../service/message.service");
var idioma_1 = require("../data/idioma");
var BitNotificationFrontComponent = /** @class */ (function () {
function BitNotificationFrontComponent(messageService) {
var _this = this;
// Nos suscribimos a la espera de que envíen notificaciones de error
this.subscriptionErrors = messageService.observableNotificationsErrors.subscribe(function (error) {
_this.showError(error);
});
this.subscriptionErrors = messageService.observableErrors.subscribe(function (message) {
_this.showError(message);
});
}
BitNotificationFrontComponent.prototype.showError = function (error) {
this.error = idioma_1.Idioma.esEspanyolSeleccionado() ? error.textES : error.textCA;
this.masInfo = error.masInfo;
window.scrollTo(0, 0);
};
BitNotificationFrontComponent.prototype.cleanError = function () {
this.error = null;
};
BitNotificationFrontComponent.prototype.ngOnDestroy = function () {
// Prevent memory leak when component destroyed
this.error = null;
this.subscriptionErrors.unsubscribe();
};
BitNotificationFrontComponent = __decorate([
core_1.Component({
selector: "bit-notification-front",
template: "\n <div class=\"alert alert-danger margin-top-20\" role=\"alert\" *ngIf=\"error\">\n <div class=\"row\">\n <div [innerHTML]=\"error | sanitizeInnerHtml\" class=\"col-sm-12\"></div>\n </div>\n </div>\n "
}),
__metadata("design:paramtypes", [message_service_1.MessageService])
], BitNotificationFrontComponent);
return BitNotificationFrontComponent;
}());
exports.BitNotificationFrontComponent = BitNotificationFrontComponent;
//# sourceMappingURL=bit-notification-front.component.js.map