How to use the ng-zorro-antd/core.warnDeprecation function in ng-zorro-antd

To help you get started, we’ve selected a few ng-zorro-antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NG-ZORRO / ng-zorro-antd / components / empty / nz-empty.service.ts View on Github external
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());
    });
  }
github NG-ZORRO / ng-zorro-antd / components / message / nz-message-container.component.ts View on Github external
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 });
  }
github NG-ZORRO / ng-zorro-antd / components / cascader / nz-cascader.component.ts View on Github external
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.`);
    }
  }
github NG-ZORRO / ng-zorro-antd / components / dropdown / nz-dropdown-button.component.ts View on Github external
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`
    );
  }
github NG-ZORRO / ng-zorro-antd / components / ng-zorro-antd.module.ts View on Github external
constructor() {
    warnDeprecation('The `NgZorroAntdModule` has been deprecated and will be removed in 10.0.0.' + ' Please use secondary entry instead.');
  }
}
github NG-ZORRO / ng-zorro-antd / components / tree / nz-tree.component.ts View on Github external
set nzDefaultExpandAll(value: boolean) {
    warnDeprecation(`'nzDefaultExpandAll' would be removed in 9.0.0. Please use 'nzExpandAll' instead.`);
    this.nzExpandAll = value;
    this._nzDefaultExpandAll = value;
  }
github NG-ZORRO / ng-zorro-antd / components / empty / nz-empty.service.ts View on Github external
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}.`);
    }
  }
github NG-ZORRO / ng-zorro-antd / components / tree / nz-tree.component.ts View on Github external
set nzDefaultCheckedKeys(value: string[]) {
    warnDeprecation(`'nzDefaultCheckedKeys' would be removed in 9.0.0. Please use 'nzCheckedKeys' instead.`);
    this.nzDefaultSubject.next({ type: 'nzCheckedKeys', keys: value });
  }
github NG-ZORRO / ng-zorro-antd / components / tree-select / nz-tree-select.component.ts View on Github external
set nzDefaultExpandedKeys(value: string[]) {
    warnDeprecation(`'nzDefaultExpandedKeys' would be removed in 9.0.0. Please use 'nzExpandedKeys' instead.`);
    this.expandedKeys = value;
  }
  get nzDefaultExpandedKeys(): string[] {
github NG-ZORRO / ng-zorro-antd / components / code-editor / nz-code-editor.service.ts View on Github external
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);
  }