@taiga-ui/cdk
Version:
Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance
41 lines (37 loc) • 1.7 kB
JavaScript
import * as i0 from '@angular/core';
import { inject, ViewContainerRef, Directive, Input } from '@angular/core';
class TuiFor {
constructor() {
this.vcr = inject(ViewContainerRef);
this.ngForOf = [];
}
ngOnChanges() {
this.ref?.destroy();
if (this.ngForOf?.length === 0 && this.ngForEmpty) {
this.ref = this.vcr.createEmbeddedView(this.ngForEmpty);
}
else if (!this.ngForOf && this.ngForElse) {
this.ref = this.vcr.createEmbeddedView(this.ngForElse);
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiFor, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiFor, isStandalone: true, selector: "[ngFor][ngForOf][ngForElse],[ngFor][ngForOf][ngForEmpty]", inputs: { ngForOf: "ngForOf", ngForElse: "ngForElse", ngForEmpty: "ngForEmpty" }, usesOnChanges: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiFor, decorators: [{
type: Directive,
args: [{
standalone: true,
selector: '[ngFor][ngForOf][ngForElse],[ngFor][ngForOf][ngForEmpty]',
}]
}], propDecorators: { ngForOf: [{
type: Input
}], ngForElse: [{
type: Input
}], ngForEmpty: [{
type: Input
}] } });
/**
* Generated bundle index. Do not edit.
*/
export { TuiFor };
//# sourceMappingURL=taiga-ui-cdk-directives-for.mjs.map