bitfront-library
Version:
Angular CLI project with components and classes used by other Angular projects of the BIT foundation.
63 lines • 3.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BitHelpComponent = void 0;
var core_1 = require("@angular/core");
var ayuda_service_1 = require("../service/ayuda.service");
var i0 = require("@angular/core");
var i1 = require("../service/ayuda.service");
var i2 = require("@angular/common");
function BitHelpComponent_div_0_Template(rf, ctx) { if (rf & 1) {
var _r2 = i0.ɵɵgetCurrentView();
i0.ɵɵelementStart(0, "div", 1);
i0.ɵɵelementStart(1, "div", 2);
i0.ɵɵtext(2);
i0.ɵɵelementStart(3, "span", 3);
i0.ɵɵlistener("click", function BitHelpComponent_div_0_Template_span_click_3_listener() { i0.ɵɵrestoreView(_r2); var ctx_r1 = i0.ɵɵnextContext(); return ctx_r1.hideAyuda(); });
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
i0.ɵɵelementStart(4, "div", 4);
i0.ɵɵelement(5, "p", 5);
i0.ɵɵelement(6, "p", 6);
i0.ɵɵelementEnd();
i0.ɵɵelementEnd();
} if (rf & 2) {
var ctx_r0 = i0.ɵɵnextContext();
i0.ɵɵadvance(2);
i0.ɵɵtextInterpolate1(" ", ctx_r0.ayuda.header, " ");
i0.ɵɵadvance(3);
i0.ɵɵproperty("innerHTML", ctx_r0.ayuda.title, i0.ɵɵsanitizeHtml);
i0.ɵɵadvance(1);
i0.ɵɵproperty("innerHTML", ctx_r0.ayuda.body, i0.ɵɵsanitizeHtml);
} }
var BitHelpComponent = /** @class */ (function () {
function BitHelpComponent(ayudaService) {
var _this = this;
this.ayudaService = ayudaService;
this.ayuda = null;
// cada vez que el servicio emite una nueva ayuda, la mostramos
ayudaService.mostrar.subscribe(function (ayuda) {
console.log("Mostrando ayuda", ayuda);
_this.ayuda = ayuda;
});
}
/** Oculta el modal con los avisos */
BitHelpComponent.prototype.hideAyuda = function () {
this.ayuda = null;
};
BitHelpComponent.ɵfac = function BitHelpComponent_Factory(t) { return new (t || BitHelpComponent)(i0.ɵɵdirectiveInject(i1.AyudaService)); };
BitHelpComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BitHelpComponent, selectors: [["bit-help"]], decls: 1, vars: 1, consts: [["class", "ventana-ayuda", 4, "ngIf"], [1, "ventana-ayuda"], [1, "ayuda-header"], [1, "fa", "fa-close", 3, "click"], [1, "ayuda-body"], [1, "ayuda-subtitulo", 3, "innerHTML"], [3, "innerHTML"]], template: function BitHelpComponent_Template(rf, ctx) { if (rf & 1) {
i0.ɵɵtemplate(0, BitHelpComponent_div_0_Template, 7, 3, "div", 0);
} if (rf & 2) {
i0.ɵɵproperty("ngIf", ctx.ayuda);
} }, directives: [i2.NgIf], encapsulation: 2 });
return BitHelpComponent;
}());
exports.BitHelpComponent = BitHelpComponent;
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BitHelpComponent, [{
type: core_1.Component,
args: [{
selector: "bit-help",
template: "\n <div class=\"ventana-ayuda\" *ngIf=\"ayuda\">\n <div class=\"ayuda-header\">\n {{ ayuda.header }}\n <span class=\"fa fa-close\" (click)=\"hideAyuda()\"></span>\n </div>\n <div class=\"ayuda-body\">\n <p class=\"ayuda-subtitulo\" [innerHTML]=\"ayuda.title\"></p>\n <p [innerHTML]=\"ayuda.body\"></p>\n </div>\n </div>\n "
}]
}], function () { return [{ type: i1.AyudaService }]; }, null); })();
//# sourceMappingURL=bit-help.component.js.map