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 nzConfigService: NzConfigService,
@Inject(NZ_DEFAULT_EMPTY_CONTENT) @Optional() private legacyDefaultEmptyContent: Type
) {
if (legacyDefaultEmptyContent) {
warnDeprecation(`'NZ_DEFAULT_EMPTY_CONTENT' is deprecated and would be removed in 9.0.0. Please migrate to 'NZ_CONFIG'.`);
}
const userDefaultEmptyContent = this.getUserDefaultEmptyContent();
if (userDefaultEmptyContent) {
this.userDefaultContent$.next(userDefaultEmptyContent);
}
this.nzConfigService.getConfigChangeEventForComponent('empty').subscribe(() => {
this.userDefaultContent$.next(this.getUserDefaultEmptyContent());
});
}
constructor(
protected cdr: ChangeDetectorRef,
protected nzConfigService: NzConfigService,
@Optional() @Inject(NZ_MESSAGE_DEFAULT_CONFIG) defaultConfig: NzMessageConfigLegacy,
@Optional() @Inject(NZ_MESSAGE_CONFIG) config: NzMessageConfigLegacy
) {
if (!!config) {
warnDeprecation(
`Injection token 'NZ_MESSAGE_CONFIG' is deprecated and will be removed in 9.0.0. Please use 'NzConfigService' instead.`
);
}
this.setConfig({ ...defaultConfig, ...config });
}
this.dropdownWidthStyle = '';
});
this.i18nService.localeChange.pipe(startWith(), takeUntil(this.$destroy)).subscribe(() => {
this.setLocale();
});
this.nzConfigService
.getConfigChangeEventForComponent(NZ_CONFIG_COMPONENT_NAME)
.pipe(takeUntil(this.$destroy))
.subscribe(() => {
this.cdr.markForCheck();
});
if (this.nzSelect.observers.length > 0) {
warnDeprecation(`nzSelect is deprecated and will be removed in 9.0.0. Please use 'nzSelectionChange' instead.`);
}
}
constructor(
cdr: ChangeDetectorRef,
nzMenuDropdownService: NzMenuDropdownService,
@Host() @Optional() public noAnimation?: NzNoAnimationDirective
) {
super(cdr, nzMenuDropdownService, noAnimation);
warnDeprecation(
`'nz-dropdown-button' Component is going to be removed in 9.0.0. Please use 'nz-dropdown-menu' instead. Read https://ng.ant.design/components/dropdown/en`
);
}
constructor() {
warnDeprecation('The `NgZorroAntdModule` has been deprecated and will be removed in 10.0.0.' + ' Please use secondary entry instead.');
}
}
set nzDefaultExpandAll(value: boolean) {
warnDeprecation(`'nzDefaultExpandAll' would be removed in 9.0.0. Please use 'nzExpandAll' instead.`);
this.nzExpandAll = value;
this._nzDefaultExpandAll = value;
}
setDefaultContent(content?: NzEmptyCustomContent): void {
warnDeprecation(`'setDefaultContent' is deprecated and would be removed in 9.0.0. Please migrate to 'NzConfigService'.`);
if (
typeof content === 'string' ||
content === undefined ||
content === null ||
content instanceof TemplateRef ||
content instanceof Type
) {
this.userDefaultContent$.next(content);
} else {
throw new Error(`${PREFIX} 'useDefaultContent' expect 'string', 'templateRef' or 'component' but get ${content}.`);
}
}
set nzDefaultCheckedKeys(value: string[]) {
warnDeprecation(`'nzDefaultCheckedKeys' would be removed in 9.0.0. Please use 'nzCheckedKeys' instead.`);
this.nzDefaultSubject.next({ type: 'nzCheckedKeys', keys: value });
}
set nzDefaultExpandedKeys(value: string[]) {
warnDeprecation(`'nzDefaultExpandedKeys' would be removed in 9.0.0. Please use 'nzExpandedKeys' instead.`);
this.expandedKeys = value;
}
get nzDefaultExpandedKeys(): string[] {
updateDefaultOption(option: JoinedEditorOptions): void {
warnDeprecation(
`'updateDefaultOption' is deprecated and will be removed in next minor version. Please use 'set' of 'NzConfigService' instead.`
);
this._updateDefaultOption(option);
}