@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.78 kB
JavaScript
import * as i0 from '@angular/core';
import { ElementRef, Directive } from '@angular/core';
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
class TuiElement {
constructor() {
this.nativeElement = tuiInjectElement();
/**
* @note:
* Typically, when your constructor is invoked with new,
* an object is created, its constructor is assigned to
* the invoked constructor and the object is then assigned
* to this before executing any operations specified
* in your constructor method.
*
* ERROR TypeError: Class constructor ElementRef cannot be invoked without 'new'
* https://github.com/taiga-family/taiga-ui/issues/3072
*
* This way we can instantiate object creation
* without additional prototype chain for possible fix bug.
*/
return new ElementRef(this.nativeElement);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiElement, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.25", type: TuiElement, isStandalone: true, selector: "[tuiElement]", exportAs: ["elementRef"], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: TuiElement, decorators: [{
type: Directive,
args: [{
selector: '[tuiElement]',
exportAs: 'elementRef',
}]
}], ctorParameters: () => [] });
/**
* Generated bundle index. Do not edit.
*/
export { TuiElement };
//# sourceMappingURL=taiga-ui-cdk-directives-element.mjs.map