igniteui-angular-core
Version:
Ignite UI Angular Core logic used in multiple UI components.
75 lines (74 loc) • 3.7 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
export let IgxTemplateContentComponent = /*@__PURE__*/ (() => {
class IgxTemplateContentComponent {
constructor(_changeDetectorRef, viewContainer) {
this._changeDetectorRef = _changeDetectorRef;
this.viewContainer = viewContainer;
this._template = null;
this._context = null;
}
set template(value) {
this._template = value;
if (this._context != null) {
this._changeDetectorRef.detectChanges();
}
}
get template() {
return this._template;
}
set context(value) {
if (this._context == null && value == null) {
return;
}
this._context = value;
this._changeDetectorRef.detectChanges();
}
get context() {
return this._context;
}
markChanged() {
this._changeDetectorRef.detectChanges();
}
}
IgxTemplateContentComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxTemplateContentComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
IgxTemplateContentComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxTemplateContentComponent, selector: "igx-template-content", inputs: { template: "template", context: "context" }, host: { classAttribute: "ig-template-content igx-template-content" }, ngImport: i0, template: `
<ng-template #defaultTemplate>
<div></div>
</ng-template>
<ng-container *ngTemplateOutlet="template ? template : defaultTemplate; context: context">
</ng-container>
`, isInline: true, styles: ["\n :host {\n display: block;\n }\n"], directives: [{ type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxTemplateContentComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxTemplateContentComponent, decorators: [{
type: Component,
args: [{
selector: 'igx-template-content',
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<ng-template #defaultTemplate>
<div></div>
</ng-template>
<ng-container *ngTemplateOutlet="template ? template : defaultTemplate; context: context">
</ng-container>
`,
host: { class: "ig-template-content igx-template-content" },
styles: [`
:host {
display: block;
}
`]
}]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { template: [{
type: Input
}], context: [{
type: Input
}] } });