Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(private elementRef: ElementRef, private viewContainerRef: ViewContainerRef,
private componentFactoryResolver: ComponentFactoryResolver, private renderer2: Renderer2,
private injector: Injector, private devUIConfig: DevUIConfig, private i18n: I18nService,
private builder: AnimationBuilder) {
this._dateConfig = devUIConfig[`datePicker${i18n.getLangSuffix()}`];
this.dateConverter = devUIConfig[`datePicker${i18n.getLangSuffix()}`].dateConverter || new DefaultDateConverter();
this.selectedDate = null;
const factory = this.componentFactoryResolver.resolveComponentFactory(DatepickerComponent);
this.cmpRef = this.viewContainerRef.createComponent(factory, this.viewContainerRef.length, this.injector);
this.i18n.getMessage().subscribe((lang) => {
const langSuffix = lang === 'zh-CN' ? 'CN' : 'EN';
this._dateConfig = devUIConfig[`datePicker${langSuffix}`];
});
}
constructor(
protected elementRef: ElementRef,
protected renderer2: Renderer2,
protected devUIConfig: DevUIConfig,
protected changeDetectorRef: ChangeDetectorRef,
protected i18n: I18nService
) {
this._dateConfig = this.devUIConfig[`datePicker${i18n.getLangSuffix()}`];
this.dateConverter = this.devUIConfig[`datePicker${i18n.getLangSuffix()}`].dateConverter || new DefaultDateConverter();
this.renderer2.setStyle(this.elementRef.nativeElement, 'display', 'inline-block');
}