diff --git a/README-zh_CN.md b/README-zh_CN.md index 55ed42e19f..d15c654ec6 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -36,7 +36,7 @@ Ant Design 的 Angular 实现,开发和服务于企业级后台产品。 ## 🖥 支持环境 -- Angular `^8.0.0` +- Angular `^7.0.0` - 支持服务端渲染 - 现代浏览器,以及 Internet Explorer 11+ (使用 [polyfills](https://angular.io/guide/browser-support)) - [Electron](http://electron.atom.io/) diff --git a/README.md b/README.md index c027aa548e..65a653a985 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ English | [简体中文](README-zh_CN.md) ## 🖥 Environment Support -* Angular `^8.0.0` +* Angular `^7.0.0` * Server-side Rendering * Modern browsers and Internet Explorer 11+ (with [polyfills](https://angular.io/guide/browser-support)) * [Electron](http://electron.atom.io/) diff --git a/components/alert/nz-alert.spec.ts b/components/alert/nz-alert.spec.ts index ffceb6b937..5efbe404e4 100644 --- a/components/alert/nz-alert.spec.ts +++ b/components/alert/nz-alert.spec.ts @@ -136,7 +136,7 @@ describe('alert', () => { ` }) export class NzDemoTestBasicComponent { - @ViewChild('template', { static: true }) template: TemplateRef; + @ViewChild('template', { static: false }) template: TemplateRef; banner = false; closeable = false; closeText: string | TemplateRef; diff --git a/components/anchor/anchor.spec.ts b/components/anchor/anchor.spec.ts index 7ffeaa8882..9a2a715be9 100644 --- a/components/anchor/anchor.spec.ts +++ b/components/anchor/anchor.spec.ts @@ -284,7 +284,7 @@ describe('anchor', () => { ` }) export class TestComponent { - @ViewChild(NzAnchorComponent, { static: true }) comp: NzAnchorComponent; + @ViewChild(NzAnchorComponent, { static: false }) comp: NzAnchorComponent; nzAffix = true; nzBounds = 5; nzOffsetTop = 0; diff --git a/components/auto-complete/nz-autocomplete.spec.ts b/components/auto-complete/nz-autocomplete.spec.ts index 33ffbc6d96..732b6009e6 100644 --- a/components/auto-complete/nz-autocomplete.spec.ts +++ b/components/auto-complete/nz-autocomplete.spec.ts @@ -844,8 +844,8 @@ class NzTestSimpleAutocompleteComponent { inputControl = new FormControl(); options: Array = ['Burns Bay Road', 'Downing Street', 'Wall Street']; - @ViewChild(NzAutocompleteComponent, { static: true }) panel: NzAutocompleteComponent; - @ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective; + @ViewChild(NzAutocompleteComponent, { static: false }) panel: NzAutocompleteComponent; + @ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective; @ViewChildren(NzAutocompleteOptionComponent) optionComponents: QueryList; constructor() { @@ -880,8 +880,8 @@ class NzTestAutocompletePropertyComponent { overlayClassName = ''; overlayStyle = {}; options = ['Burns Bay Road', 'Downing Street', 'Wall Street']; - @ViewChild(NzAutocompleteComponent, { static: true }) panel: NzAutocompleteComponent; - @ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective; + @ViewChild(NzAutocompleteComponent, { static: false }) panel: NzAutocompleteComponent; + @ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective; constructor() {} } @@ -892,7 +892,7 @@ class NzTestAutocompletePropertyComponent { ` }) class NzTestAutocompleteWithoutPanelComponent { - @ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective; + @ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective; } @Component({ @@ -906,7 +906,7 @@ class NzTestAutocompleteWithoutPanelComponent { }) class NzTestAutocompleteWithOnPushDelayComponent implements OnInit { options: string[] = []; - @ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective; + @ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective; ngOnInit(): void { setTimeout(() => { @@ -975,7 +975,7 @@ class NzTestAutocompleteGroupComponent { } ]; - @ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective; + @ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective; } @Component({ @@ -991,7 +991,7 @@ class NzTestAutocompleteGroupComponent { class NzTestAutocompleteWithFormComponent { form: FormGroup; options = ['Burns Bay Road', 'Downing Street', 'Wall Street']; - @ViewChild(NzAutocompleteTriggerDirective, { static: true }) trigger: NzAutocompleteTriggerDirective; + @ViewChild(NzAutocompleteTriggerDirective, { static: false }) trigger: NzAutocompleteTriggerDirective; constructor(private fb: FormBuilder) { this.form = this.fb.group({ formControl: 'Burns' }); diff --git a/components/avatar/avatar.spec.ts b/components/avatar/avatar.spec.ts index db7bf192db..7000d2d2dd 100644 --- a/components/avatar/avatar.spec.ts +++ b/components/avatar/avatar.spec.ts @@ -177,7 +177,7 @@ describe('avatar', () => { styleUrls: ['./style/index.less'] }) class TestAvatarComponent { - @ViewChild('comp', { static: true }) comp: NzAvatarComponent; + @ViewChild('comp', { static: false }) comp: NzAvatarComponent; nzShape = 'square'; nzSize: string | number = 'large'; nzIcon: string | null = 'anticon anticon-user'; diff --git a/components/back-top/back-top.spec.ts b/components/back-top/back-top.spec.ts index f49c9fae4b..8148faef70 100644 --- a/components/back-top/back-top.spec.ts +++ b/components/back-top/back-top.spec.ts @@ -217,7 +217,7 @@ class TestBackTopComponent { ` }) class TestBackTopTemplateComponent { - @ViewChild(NzBackTopComponent, { static: true }) + @ViewChild(NzBackTopComponent, { static: false }) nzBackTopComponent: NzBackTopComponent; } diff --git a/components/carousel/nz-carousel.spec.ts b/components/carousel/nz-carousel.spec.ts index a9bb79bbc5..6e4294ce61 100644 --- a/components/carousel/nz-carousel.spec.ts +++ b/components/carousel/nz-carousel.spec.ts @@ -34,7 +34,7 @@ import { NzCarouselOpacityStrategy } from './strategies/opacity-strategy'; ` }) export class NzTestCarouselBasicComponent { - @ViewChild(NzCarouselComponent, { static: true }) nzCarouselComponent: NzCarouselComponent; + @ViewChild(NzCarouselComponent, { static: false }) nzCarouselComponent: NzCarouselComponent; dots = true; vertical = false; effect = 'scrollx'; diff --git a/components/checkbox/nz-checkbox.spec.ts b/components/checkbox/nz-checkbox.spec.ts index 6ad0ed9685..60c88085ab 100644 --- a/components/checkbox/nz-checkbox.spec.ts +++ b/components/checkbox/nz-checkbox.spec.ts @@ -317,7 +317,7 @@ describe('checkbox', () => { ` }) export class NzTestCheckboxSingleComponent { - @ViewChild(NzCheckboxComponent, { static: true }) nzCheckboxComponent: NzCheckboxComponent; + @ViewChild(NzCheckboxComponent, { static: false }) nzCheckboxComponent: NzCheckboxComponent; disabled = false; autoFocus = false; checked = false; diff --git a/components/collapse/nz-collapse.spec.ts b/components/collapse/nz-collapse.spec.ts index 6113167d99..d8a5b2781a 100644 --- a/components/collapse/nz-collapse.spec.ts +++ b/components/collapse/nz-collapse.spec.ts @@ -192,7 +192,7 @@ describe('collapse', () => { ` }) export class NzTestCollapseBasicComponent { - @ViewChild('headerTemplate', { static: true }) headerTemplate: TemplateRef; + @ViewChild('headerTemplate', { static: false }) headerTemplate: TemplateRef; accordion = false; bordered = true; disabled = false; diff --git a/components/core/wave/nz-wave.spec.ts b/components/core/wave/nz-wave.spec.ts index 5439feab9c..91301810a9 100644 --- a/components/core/wave/nz-wave.spec.ts +++ b/components/core/wave/nz-wave.spec.ts @@ -259,7 +259,7 @@ class WaveContainerWithButtonComponent { borderColor = 'rgb(0,255,0)'; backgroundColor = 'rgb(255,255,255)'; @ViewChild('trigger', { static: false }) trigger: ElementRef; - @ViewChild(NzWaveDirective, { static: true }) wave: NzWaveDirective; + @ViewChild(NzWaveDirective, { static: false }) wave: NzWaveDirective; } @Component({ @@ -283,5 +283,5 @@ class WaveContainerWithExtraNodeComponent { borderColor = 'rgb(0,255,0)'; backgroundColor = 'rgb(255,255,255)'; @ViewChild('trigger', { static: false }) trigger: ElementRef; - @ViewChild(NzWaveDirective, { static: true }) wave: NzWaveDirective; + @ViewChild(NzWaveDirective, { static: false }) wave: NzWaveDirective; } diff --git a/components/divider/divider.spec.ts b/components/divider/divider.spec.ts index 2f7307cfa3..61f1d274a6 100644 --- a/components/divider/divider.spec.ts +++ b/components/divider/divider.spec.ts @@ -82,7 +82,7 @@ describe('divider', () => { ` }) class TestDividerComponent { - @ViewChild('comp', { static: true }) comp: NzDividerComponent; + @ViewChild('comp', { static: false }) comp: NzDividerComponent; nzDashed = false; nzType = 'horizontal'; nzText?: string = 'with text'; diff --git a/components/drawer/nz-drawer.spec.ts b/components/drawer/nz-drawer.spec.ts index bc443d222b..8df137d46f 100644 --- a/components/drawer/nz-drawer.spec.ts +++ b/components/drawer/nz-drawer.spec.ts @@ -526,9 +526,9 @@ class NzTestDrawerComponent { placement = 'left'; offsetX = 0; offsetY = 0; - @ViewChild('customTitle', { static: true }) templateTitle: TemplateRef; + @ViewChild('customTitle', { static: false }) templateTitle: TemplateRef; - @ViewChild(NzDrawerComponent, { static: true }) drawerComponent: NzDrawerComponent; + @ViewChild(NzDrawerComponent, { static: false }) drawerComponent: NzDrawerComponent; open(): void { this.visible = true; @@ -548,7 +548,7 @@ class NzTestDrawerComponent { ` }) class NzTestDrawerWithServiceComponent { - @ViewChild('drawerTemplate', { static: true }) drawerTemplate: TemplateRef<{ + @ViewChild('drawerTemplate', { static: false }) drawerTemplate: TemplateRef<{ $implicit: number; drawerRef: NzDrawerRef; }>; diff --git a/components/dropdown/nz-dropdown.spec.ts b/components/dropdown/nz-dropdown.spec.ts index ae2ffe6edd..39d75f8bcc 100644 --- a/components/dropdown/nz-dropdown.spec.ts +++ b/components/dropdown/nz-dropdown.spec.ts @@ -457,9 +457,9 @@ describe('dropdown', () => { styles: [] }) export class NzTestDropdownComponent { - @ViewChild(NzDropDownComponent, { static: true }) nzDropDownComponent: NzDropDownComponent; + @ViewChild(NzDropDownComponent, { static: false }) nzDropDownComponent: NzDropDownComponent; @ViewChild(NzDropDownDirective, { static: true }) nzDropDownDirective: NzDropDownDirective; - @ViewChild(NzSubMenuComponent, { static: true }) nzSubMenuComponent: NzSubMenuComponent; + @ViewChild(NzSubMenuComponent, { static: false }) nzSubMenuComponent: NzSubMenuComponent; visible = false; selectable = true; itemSelected = false; diff --git a/components/empty/nz-empty.spec.ts b/components/empty/nz-empty.spec.ts index 6bccb6b085..87d54935ca 100644 --- a/components/empty/nz-empty.spec.ts +++ b/components/empty/nz-empty.spec.ts @@ -301,9 +301,9 @@ describe('nz-empty', () => { ` }) export class NzEmptyTestBasicComponent { - @ViewChild('imageTpl', { static: true }) imageTpl: TemplateRef; - @ViewChild('contentTpl', { static: true }) contentTpl: TemplateRef; - @ViewChild('footerTpl', { static: true }) footerTpl: TemplateRef; + @ViewChild('imageTpl', { static: false }) imageTpl: TemplateRef; + @ViewChild('contentTpl', { static: false }) contentTpl: TemplateRef; + @ViewChild('footerTpl', { static: false }) footerTpl: TemplateRef; image?: TemplateRef | string; content?: TemplateRef | string; @@ -320,7 +320,7 @@ export class NzEmptyTestBasicComponent { ` }) export class NzEmptyTestServiceComponent { - @ViewChild('tpl', { static: true }) template: TemplateRef; + @ViewChild('tpl', { static: false }) template: TemplateRef; noResult?: string | null; diff --git a/components/input-number/nz-input-number.spec.ts b/components/input-number/nz-input-number.spec.ts index 2ff03a46fd..1f39db3a19 100644 --- a/components/input-number/nz-input-number.spec.ts +++ b/components/input-number/nz-input-number.spec.ts @@ -466,7 +466,7 @@ describe('input number', () => { ` }) export class NzTestInputNumberBasicComponent { - @ViewChild(NzInputNumberComponent, { static: true }) nzInputNumberComponent: NzInputNumberComponent; + @ViewChild(NzInputNumberComponent, { static: false }) nzInputNumberComponent: NzInputNumberComponent; value?: number | string; autofocus = false; disabled = false; diff --git a/components/input/nz-input-group.spec.ts b/components/input/nz-input-group.spec.ts index 4c2d8f78f8..735ee824d8 100644 --- a/components/input/nz-input-group.spec.ts +++ b/components/input/nz-input-group.spec.ts @@ -232,8 +232,8 @@ describe('input-group', () => { ` }) export class NzTestInputGroupAddonComponent { - @ViewChild('beforeTemplate', { static: true }) beforeTemplate: TemplateRef; - @ViewChild('afterTemplate', { static: true }) afterTemplate: TemplateRef; + @ViewChild('beforeTemplate', { static: false }) beforeTemplate: TemplateRef; + @ViewChild('afterTemplate', { static: false }) afterTemplate: TemplateRef; beforeContent: string | TemplateRef; afterContent: string | TemplateRef; size = 'default'; @@ -250,8 +250,8 @@ export class NzTestInputGroupAddonComponent { ` }) export class NzTestInputGroupAffixComponent { - @ViewChild('beforeTemplate', { static: true }) beforeTemplate: TemplateRef; - @ViewChild('afterTemplate', { static: true }) afterTemplate: TemplateRef; + @ViewChild('beforeTemplate', { static: false }) beforeTemplate: TemplateRef; + @ViewChild('afterTemplate', { static: false }) afterTemplate: TemplateRef; beforeContent: string | TemplateRef; afterContent: string | TemplateRef; size = 'default'; diff --git a/components/list/list.spec.ts b/components/list/list.spec.ts index d89ed31447..6a1692cc2e 100644 --- a/components/list/list.spec.ts +++ b/components/list/list.spec.ts @@ -225,7 +225,7 @@ describe('list', () => { ` }) class TestListComponent { - @ViewChild('comp', { static: true }) comp: NzListComponent; + @ViewChild('comp', { static: false }) comp: NzListComponent; nzItemLayout = 'horizontal'; nzBordered = false; nzFooter = 'footer'; @@ -253,7 +253,7 @@ class TestListComponent { ` }) class TestListWithTemplateComponent { - @ViewChild('nzFooter', { static: true }) nzFooter: TemplateRef; + @ViewChild('nzFooter', { static: false }) nzFooter: TemplateRef; footer: string | TemplateRef = 'footer with string'; } diff --git a/components/mention/nz-mention.spec.ts b/components/mention/nz-mention.spec.ts index d517b7747d..246d771345 100644 --- a/components/mention/nz-mention.spec.ts +++ b/components/mention/nz-mention.spec.ts @@ -442,8 +442,8 @@ describe('mention', () => { class NzTestSimpleMentionComponent { inputValue: string = '@angular'; suggestions = ['angular', 'ant-design', 'mention', '中文', 'にほんご']; - @ViewChild(NzMentionComponent, { static: true }) mention: NzMentionComponent; - @ViewChild(NzMentionTriggerDirective, { static: true }) trigger: NzMentionTriggerDirective; + @ViewChild(NzMentionComponent, { static: false }) mention: NzMentionComponent; + @ViewChild(NzMentionTriggerDirective, { static: false }) trigger: NzMentionTriggerDirective; } @Component({ @@ -475,8 +475,8 @@ class NzTestPropertyMentionComponent { loading = false; prefix: string | string[] = '@'; valueWith = (data: { name: string; type: string }) => data.name; - @ViewChild(NzMentionComponent, { static: true }) mention: NzMentionComponent; - @ViewChild(NzMentionTriggerDirective, { static: true }) trigger: NzMentionTriggerDirective; + @ViewChild(NzMentionComponent, { static: false }) mention: NzMentionComponent; + @ViewChild(NzMentionTriggerDirective, { static: false }) trigger: NzMentionTriggerDirective; setArrayPrefix(): void { this.prefix = ['@', '#']; diff --git a/components/pagination/nz-pagination.spec.ts b/components/pagination/nz-pagination.spec.ts index 8d55f559a1..031e241c64 100644 --- a/components/pagination/nz-pagination.spec.ts +++ b/components/pagination/nz-pagination.spec.ts @@ -317,7 +317,7 @@ describe('pagination', () => { ` }) export class NzTestPaginationComponent { - @ViewChild(NzPaginationComponent, { static: true }) nzPaginationComponent: NzPaginationComponent; + @ViewChild(NzPaginationComponent, { static: false }) nzPaginationComponent: NzPaginationComponent; pageIndex = 1; pageSize = 10; total = 50; diff --git a/components/popconfirm/nz-popconfirm.spec.ts b/components/popconfirm/nz-popconfirm.spec.ts index 7a3cd87788..df0ee65f0f 100644 --- a/components/popconfirm/nz-popconfirm.spec.ts +++ b/components/popconfirm/nz-popconfirm.spec.ts @@ -318,10 +318,10 @@ export class NzpopconfirmTestNewComponent { cancel = jasmine.createSpy('cancel'); condition = false; icon: string | undefined = undefined; - @ViewChild('stringTemplate', { static: true }) stringTemplate: ElementRef; - @ViewChild('templateTemplate', { static: true }) templateTemplate: ElementRef; - @ViewChild('inBtnGroup', { static: true }) inBtnGroup: ElementRef; - @ViewChild('iconTemplate', { static: true }) iconTemplate: ElementRef; + @ViewChild('stringTemplate', { static: false }) stringTemplate: ElementRef; + @ViewChild('templateTemplate', { static: false }) templateTemplate: ElementRef; + @ViewChild('inBtnGroup', { static: false }) inBtnGroup: ElementRef; + @ViewChild('iconTemplate', { static: false }) iconTemplate: ElementRef; } @Component({ @@ -357,19 +357,19 @@ export class NzpopconfirmTestNewComponent { export class NzpopconfirmTestWrapperComponent { nzOkType = 'primary'; - @ViewChild('normalTrigger', { static: true }) normalTrigger: ElementRef; + @ViewChild('normalTrigger', { static: false }) normalTrigger: ElementRef; - @ViewChild('templateTrigger', { static: true }) templateTrigger: ElementRef; + @ViewChild('templateTrigger', { static: false }) templateTrigger: ElementRef; - @ViewChild('focusTrigger', { static: true }) focusTrigger: ElementRef; + @ViewChild('focusTrigger', { static: false }) focusTrigger: ElementRef; - @ViewChild('clickTrigger', { static: true }) clickTrigger: ElementRef; + @ViewChild('clickTrigger', { static: false }) clickTrigger: ElementRef; visible: boolean; - @ViewChild('visibleTrigger', { static: true }) visibleTrigger: ElementRef; + @ViewChild('visibleTrigger', { static: false }) visibleTrigger: ElementRef; executeCondition: boolean; - @ViewChild('executeTrigger', { static: true }) executeTrigger: ElementRef; + @ViewChild('executeTrigger', { static: false }) executeTrigger: ElementRef; onConfirm(): void {} diff --git a/components/popover/nz-popover.spec.ts b/components/popover/nz-popover.spec.ts index dad9538660..ba31576143 100644 --- a/components/popover/nz-popover.spec.ts +++ b/components/popover/nz-popover.spec.ts @@ -209,13 +209,13 @@ describe('NzPopover', () => { ` }) export class NzPopoverTestNewComponent { - @ViewChild('stringPopover', { static: true }) stringPopover: ElementRef; + @ViewChild('stringPopover', { static: false }) stringPopover: ElementRef; @ViewChild('stringPopover', { static: false, read: NzPopoverDirective }) stringPopoverNzPopoverDirective: NzPopoverDirective; - @ViewChild('templatePopover', { static: true }) templatePopover: ElementRef; + @ViewChild('templatePopover', { static: false }) templatePopover: ElementRef; @ViewChild('templatePopover', { static: false, read: NzPopoverDirective }) templatePopoverNzPopoverDirective: NzPopoverDirective; - @ViewChild('inBtnGroup', { static: true }) inBtnGroup: ElementRef; + @ViewChild('inBtnGroup', { static: false }) inBtnGroup: ElementRef; } @Component({ @@ -236,14 +236,14 @@ export class NzPopoverTestNewComponent { ` }) export class NzPopoverTestWrapperComponent { - @ViewChild('normalTrigger', { static: true }) normalTrigger: ElementRef; + @ViewChild('normalTrigger', { static: false }) normalTrigger: ElementRef; - @ViewChild('templateTrigger', { static: true }) templateTrigger: ElementRef; + @ViewChild('templateTrigger', { static: false }) templateTrigger: ElementRef; - @ViewChild('focusTrigger', { static: true }) focusTrigger: ElementRef; + @ViewChild('focusTrigger', { static: false }) focusTrigger: ElementRef; - @ViewChild('clickTrigger', { static: true }) clickTrigger: ElementRef; + @ViewChild('clickTrigger', { static: false }) clickTrigger: ElementRef; visible: boolean; - @ViewChild('visibleTrigger', { static: true }) visibleTrigger: ElementRef; + @ViewChild('visibleTrigger', { static: false }) visibleTrigger: ElementRef; } diff --git a/components/radio/nz-radio.spec.ts b/components/radio/nz-radio.spec.ts index c1c12066bf..6b1e523085 100644 --- a/components/radio/nz-radio.spec.ts +++ b/components/radio/nz-radio.spec.ts @@ -318,7 +318,7 @@ describe('radio', () => { ` }) export class NzTestRadioSingleComponent { - @ViewChild(NzRadioComponent, { static: true }) nzRadioComponent: NzRadioComponent; + @ViewChild(NzRadioComponent, { static: false }) nzRadioComponent: NzRadioComponent; value = false; autoFocus = false; disabled = false; diff --git a/components/rate/nz-rate.spec.ts b/components/rate/nz-rate.spec.ts index 747783e732..0200dd4602 100644 --- a/components/rate/nz-rate.spec.ts +++ b/components/rate/nz-rate.spec.ts @@ -256,7 +256,7 @@ describe('rate', () => { ` }) export class NzTestRateBasicComponent { - @ViewChild(NzRateComponent, { static: true }) nzRateComponent: NzRateComponent; + @ViewChild(NzRateComponent, { static: false }) nzRateComponent: NzRateComponent; count = 5; autoFocus = false; allowHalf = false; diff --git a/components/spin/nz-spin.spec.ts b/components/spin/nz-spin.spec.ts index cf4add544c..016560d9c2 100644 --- a/components/spin/nz-spin.spec.ts +++ b/components/spin/nz-spin.spec.ts @@ -120,7 +120,7 @@ describe('spin', () => { ` }) export class NzTestSpinBasicComponent { - @ViewChild('indicatorTemplate', { static: true }) indicatorTemplate: TemplateRef; + @ViewChild('indicatorTemplate', { static: false }) indicatorTemplate: TemplateRef; size = 'default'; delay = 0; spinning = true; diff --git a/components/steps/nz-steps.spec.ts b/components/steps/nz-steps.spec.ts index 410fe236ba..dc17a05ab9 100644 --- a/components/steps/nz-steps.spec.ts +++ b/components/steps/nz-steps.spec.ts @@ -387,7 +387,7 @@ describe('steps', () => { changeDetection: ChangeDetectionStrategy.OnPush }) export class NzTestOuterStepsComponent { - @ViewChild('progressTemplate', { static: true }) progressTemplate: TemplateRef; + @ViewChild('progressTemplate', { static: false }) progressTemplate: TemplateRef; current = 0; direction = 'horizontal'; labelPlacement = 'horizontal'; @@ -412,9 +412,9 @@ export class NzTestOuterStepsComponent { ` }) export class NzTestInnerStepStringComponent { - @ViewChild('titleTemplate', { static: true }) titleTemplate: TemplateRef; - @ViewChild('descriptionTemplate', { static: true }) descriptionTemplate: TemplateRef; - @ViewChild('iconTemplate', { static: true }) iconTemplate: TemplateRef; + @ViewChild('titleTemplate', { static: false }) titleTemplate: TemplateRef; + @ViewChild('descriptionTemplate', { static: false }) descriptionTemplate: TemplateRef; + @ViewChild('iconTemplate', { static: false }) iconTemplate: TemplateRef; status = 'process'; current = 1; icon = 'anticon anticon-user'; diff --git a/components/switch/nz-switch.spec.ts b/components/switch/nz-switch.spec.ts index ea4175e9fe..35f3bf2bcc 100644 --- a/components/switch/nz-switch.spec.ts +++ b/components/switch/nz-switch.spec.ts @@ -248,9 +248,9 @@ describe('switch', () => { ` }) export class NzTestSwitchBasicComponent { - @ViewChild(NzSwitchComponent, { static: true }) nzSwitchComponent: NzSwitchComponent; - @ViewChild('checkedChildrenTemplate', { static: true }) checkedChildrenTemplate: TemplateRef; - @ViewChild('unCheckedChildrenTemplate', { static: true }) unCheckedChildrenTemplate: TemplateRef; + @ViewChild(NzSwitchComponent, { static: false }) nzSwitchComponent: NzSwitchComponent; + @ViewChild('checkedChildrenTemplate', { static: false }) checkedChildrenTemplate: TemplateRef; + @ViewChild('unCheckedChildrenTemplate', { static: false }) unCheckedChildrenTemplate: TemplateRef; checkedChildren = 'on'; unCheckedChildren = 'off'; value = false; diff --git a/components/table/nz-table.spec.ts b/components/table/nz-table.spec.ts index e400a10dbd..2c026752da 100644 --- a/components/table/nz-table.spec.ts +++ b/components/table/nz-table.spec.ts @@ -365,7 +365,7 @@ describe('nz-table', () => { ` }) export class NzTestTableBasicComponent implements OnInit { - @ViewChild(NzTableComponent, { static: true }) nzTableComponent: NzTableComponent; + @ViewChild(NzTableComponent, { static: false }) nzTableComponent: NzTableComponent; pageIndex = 1; pageIndexChange = jasmine.createSpy('pageIndex callback'); pageSize = 10; @@ -451,7 +451,7 @@ export class NzTestTableBasicComponent implements OnInit { styleUrls: ['../style/index.less', '../spin/style/index.less', './style/index.less'] }) export class NzTestTableScrollComponent implements OnInit { - @ViewChild(NzTableComponent, { static: true }) nzTableComponent: NzTableComponent; + @ViewChild(NzTableComponent, { static: false }) nzTableComponent: NzTableComponent; dataSet: Array<{ name: string; age: number; address: string }> = []; width = 300; diff --git a/components/table/nz-th.spec.ts b/components/table/nz-th.spec.ts index 835bfcdcfa..fec69bc006 100644 --- a/components/table/nz-th.spec.ts +++ b/components/table/nz-th.spec.ts @@ -430,7 +430,7 @@ export class NzThTestTableDefaultFilterComponent { ]; displayData: Array<{ name: string; age: number; address: string; [key: string]: string | number }> = []; - @ViewChild(NzThComponent, { static: true }) nzThComponent: NzThComponent; + @ViewChild(NzThComponent, { static: false }) nzThComponent: NzThComponent; sort(sort: { key: string; value: string }): void { this.sortName = sort.key; diff --git a/components/tabs/nz-tabs.spec.ts b/components/tabs/nz-tabs.spec.ts index cfdc047e02..e37ac8d93c 100644 --- a/components/tabs/nz-tabs.spec.ts +++ b/components/tabs/nz-tabs.spec.ts @@ -536,8 +536,8 @@ describe('tabs', () => { }) export class NzTestTabsBasicComponent { add = false; - @ViewChild('extraTemplate', { static: true }) extraTemplate: TemplateRef; - @ViewChild(NzTabSetComponent, { static: true }) nzTabSetComponent: NzTabSetComponent; + @ViewChild('extraTemplate', { static: false }) extraTemplate: TemplateRef; + @ViewChild(NzTabSetComponent, { static: false }) nzTabSetComponent: NzTabSetComponent; selectedIndex = 0; selectedIndexChange = jasmine.createSpy('selectedIndex callback'); selectChange = jasmine.createSpy('selectedIndex callback'); diff --git a/components/time-picker/nz-time-picker-panel.component.spec.ts b/components/time-picker/nz-time-picker-panel.component.spec.ts index c5addb878a..3574adae19 100644 --- a/components/time-picker/nz-time-picker-panel.component.spec.ts +++ b/components/time-picker/nz-time-picker-panel.component.spec.ts @@ -304,7 +304,7 @@ export class NzTestTimePanelComponent { secondStep = 1; minuteStep = 1; hourStep = 1; - @ViewChild(NzTimePickerPanelComponent, { static: true }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; + @ViewChild(NzTimePickerPanelComponent, { static: false }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; value: Date; openValue = new Date(0, 0, 0, 10, 11, 12); format: string | null = 'HH:mm:ss'; @@ -337,7 +337,7 @@ export class NzTestTimePanelDisabledComponent { minuteStep = 1; hourStep = 1; hideDisabledOptions = false; - @ViewChild(NzTimePickerPanelComponent, { static: true }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; + @ViewChild(NzTimePickerPanelComponent, { static: false }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; value = new Date(0, 0, 0, 0, 0, 0); openValue = new Date(0, 0, 0, 10, 11, 12); format = 'HH:mm:ss'; @@ -378,7 +378,7 @@ export class NzTestTimePanelDisabledComponent { styleUrls: ['../style/index.less', './style/index.less'] }) export class NzTest12HourTimePanelComponent { - @ViewChild(NzTimePickerPanelComponent, { static: true }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; + @ViewChild(NzTimePickerPanelComponent, { static: false }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; format = 'hh:mm:ss a'; hourStep = 1; value: Date; @@ -401,7 +401,7 @@ export class NzTest12HourTimePanelComponent { styleUrls: ['../style/index.less', './style/index.less'] }) export class NzTest12HourTimePanelDisabeledComponent { - @ViewChild(NzTimePickerPanelComponent, { static: true }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; + @ViewChild(NzTimePickerPanelComponent, { static: false }) nzTimePickerPanelComponent: NzTimePickerPanelComponent; format = 'hh:mm:ss a'; value = new Date(0, 0, 0, 1, 1, 1); disabledHours = (): number[] => []; diff --git a/components/time-picker/nz-time-picker.component.spec.ts b/components/time-picker/nz-time-picker.component.spec.ts index 641f3b7678..a3bb309acf 100644 --- a/components/time-picker/nz-time-picker.component.spec.ts +++ b/components/time-picker/nz-time-picker.component.spec.ts @@ -125,5 +125,5 @@ export class NzTestTimePickerComponent { date = new Date(); disabled = false; use12Hours = false; - @ViewChild(NzTimePickerComponent, { static: true }) nzTimePickerComponent: NzTimePickerComponent; + @ViewChild(NzTimePickerComponent, { static: false }) nzTimePickerComponent: NzTimePickerComponent; } diff --git a/components/time-picker/nz-time-value-accessor.directive.spec.ts b/components/time-picker/nz-time-value-accessor.directive.spec.ts index a301501408..acf2b24e9a 100644 --- a/components/time-picker/nz-time-value-accessor.directive.spec.ts +++ b/components/time-picker/nz-time-value-accessor.directive.spec.ts @@ -71,6 +71,7 @@ describe('input-time', () => { ` }) export class NzTestTimeInputComponent { - @ViewChild(NzTimeValueAccessorDirective, { static: true }) nzTimeValueAccessorDirective: NzTimeValueAccessorDirective; + @ViewChild(NzTimeValueAccessorDirective, { static: false }) + nzTimeValueAccessorDirective: NzTimeValueAccessorDirective; value = new Date(0, 0, 0, 0, 0, 0); } diff --git a/components/tooltip/nz-tooltip.spec.ts b/components/tooltip/nz-tooltip.spec.ts index 970a5e23e8..b38367608a 100644 --- a/components/tooltip/nz-tooltip.spec.ts +++ b/components/tooltip/nz-tooltip.spec.ts @@ -37,13 +37,13 @@ import { NzToolTipModule } from './nz-tooltip.module'; ` }) export class NzTooltipTestDirectiveComponent { - @ViewChild('titleString', { static: true }) titleString: ElementRef; + @ViewChild('titleString', { static: false }) titleString: ElementRef; @ViewChild('titleString', { static: false, read: NzTooltipDirective }) titleStringNzTooltipDirective: NzTooltipDirective; - @ViewChild('titleTemplate', { static: true }) titleTemplate: ElementRef; + @ViewChild('titleTemplate', { static: false }) titleTemplate: ElementRef; @ViewChild('titleTemplate', { static: false, read: NzTooltipDirective }) titleTemplateNzTooltipDirective: NzTooltipDirective; - @ViewChild('inBtnGroup', { static: true }) inBtnGroup: ElementRef; + @ViewChild('inBtnGroup', { static: false }) inBtnGroup: ElementRef; title = 'title-string'; } @@ -62,13 +62,13 @@ export class NzTooltipTestDirectiveComponent { ` }) export class NzTooltipTestWrapperComponent { - @ViewChild('clickTrigger', { static: true }) clickTrigger: ElementRef; - @ViewChild('focusTrigger', { static: true }) focusTrigger: ElementRef; + @ViewChild('clickTrigger', { static: false }) clickTrigger: ElementRef; + @ViewChild('focusTrigger', { static: false }) focusTrigger: ElementRef; @ViewChild('mostSimpleTrigger', { static: false, read: NzTooltipDirective }) mostSimpleDirective: NzTooltipDirective; - @ViewChild('mostSimpleTrigger', { static: true }) mostSimpleTrigger: ElementRef; - @ViewChild('normalTrigger', { static: true }) normalTrigger: ElementRef; - @ViewChild('templateTrigger', { static: true }) templateTrigger: ElementRef; - @ViewChild('visibleTrigger', { static: true }) visibleTrigger: ElementRef; + @ViewChild('mostSimpleTrigger', { static: false }) mostSimpleTrigger: ElementRef; + @ViewChild('normalTrigger', { static: false }) normalTrigger: ElementRef; + @ViewChild('templateTrigger', { static: false }) templateTrigger: ElementRef; + @ViewChild('visibleTrigger', { static: false }) visibleTrigger: ElementRef; visible: boolean; } diff --git a/components/transfer/transfer.spec.ts b/components/transfer/transfer.spec.ts index b0c8a94ff1..88cf62c6b6 100644 --- a/components/transfer/transfer.spec.ts +++ b/components/transfer/transfer.spec.ts @@ -385,7 +385,7 @@ describe('transfer', () => { encapsulation: ViewEncapsulation.None }) class TestTransferComponent implements OnInit { - @ViewChild('comp', { static: true }) comp: NzTransferComponent; + @ViewChild('comp', { static: false }) comp: NzTransferComponent; nzDataSource: any[] = []; nzDisabled = false; nzTitles = ['Source', 'Target']; @@ -442,7 +442,7 @@ class TestTransferComponent implements OnInit { ` }) class TestTransferCustomRenderComponent implements OnInit { - @ViewChild('comp', { static: true }) comp: NzTransferComponent; + @ViewChild('comp', { static: false }) comp: NzTransferComponent; nzDataSource: Array<{ key: string; title: string; description: string; direction: string; icon: string }> = []; ngOnInit(): void { diff --git a/components/tree-select/nz-tree-select.spec.ts b/components/tree-select/nz-tree-select.spec.ts index e9dc35ae1e..5ac79d18b3 100644 --- a/components/tree-select/nz-tree-select.spec.ts +++ b/components/tree-select/nz-tree-select.spec.ts @@ -503,7 +503,7 @@ describe('tree-select component', () => { ` }) export class NzTestTreeSelectBasicComponent { - @ViewChild(NzTreeSelectComponent, { static: true }) nzSelectTreeComponent: NzTreeSelectComponent; + @ViewChild(NzTreeSelectComponent, { static: false }) nzSelectTreeComponent: NzTreeSelectComponent; expandKeys = ['1001', '10001']; value: string | string[] | null = '10001'; size = 'default'; @@ -594,7 +594,7 @@ export class NzTestTreeSelectBasicComponent { ` }) export class NzTestTreeSelectCheckableComponent { - @ViewChild(NzTreeSelectComponent, { static: true }) nzSelectTreeComponent: NzTreeSelectComponent; + @ViewChild(NzTreeSelectComponent, { static: false }) nzSelectTreeComponent: NzTreeSelectComponent; expandKeys = ['1001', '10001']; value: string[] | null = ['1000122']; showSearch = false; diff --git a/components/upload/upload.spec.ts b/components/upload/upload.spec.ts index 217ad19178..de56bac956 100644 --- a/components/upload/upload.spec.ts +++ b/components/upload/upload.spec.ts @@ -1344,7 +1344,7 @@ class TestUploadComponent { encapsulation: ViewEncapsulation.None }) class TestUploadListComponent { - @ViewChild('list', { static: true }) comp: NzUploadListComponent; + @ViewChild('list', { static: false }) comp: NzUploadListComponent; listType: UploadListType = 'picture-card'; items: any[] = [ { @@ -1388,7 +1388,7 @@ class TestUploadListComponent { ` }) class TestUploadBtnComponent { - @ViewChild('btn', { static: true }) comp: NzUploadBtnComponent; + @ViewChild('btn', { static: false }) comp: NzUploadBtnComponent; classes: string[] = ['test']; options: ZipButtonOptions = { disabled: false,