@@ -18,8 +18,8 @@ import {
18
18
ZERO
19
19
} from '@angular/cdk/keycodes' ;
20
20
import { OverlayContainer } from '@angular/cdk/overlay' ;
21
- import { Component , DebugElement , TemplateRef , ViewChild } from '@angular/core' ;
22
- import { ComponentFixture , fakeAsync , flush , inject , TestBed , tick } from '@angular/core/testing' ;
21
+ import { Component , DebugElement , inject , TemplateRef , ViewChild } from '@angular/core' ;
22
+ import { ComponentFixture , fakeAsync , flush , inject as testingInject , TestBed , tick } from '@angular/core/testing' ;
23
23
import { FormBuilder , FormControl , FormGroup , FormsModule , ReactiveFormsModule , Validators } from '@angular/forms' ;
24
24
import { By } from '@angular/platform-browser' ;
25
25
import { provideNoopAnimations } from '@angular/platform-browser/animations' ;
@@ -73,15 +73,19 @@ describe('cascader', () => {
73
73
} ) ;
74
74
} ) ;
75
75
76
- beforeEach ( inject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
77
- overlayContainer = currentOverlayContainer ;
78
- overlayContainerElement = currentOverlayContainer . getContainerElement ( ) ;
79
- } ) ) ;
76
+ beforeEach (
77
+ testingInject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
78
+ overlayContainer = currentOverlayContainer ;
79
+ overlayContainerElement = currentOverlayContainer . getContainerElement ( ) ;
80
+ } )
81
+ ) ;
80
82
81
- afterEach ( inject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
82
- currentOverlayContainer . ngOnDestroy ( ) ;
83
- overlayContainer . ngOnDestroy ( ) ;
84
- } ) ) ;
83
+ afterEach (
84
+ testingInject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
85
+ currentOverlayContainer . ngOnDestroy ( ) ;
86
+ overlayContainer . ngOnDestroy ( ) ;
87
+ } )
88
+ ) ;
85
89
86
90
describe ( 'default' , ( ) => {
87
91
let fixture : ComponentFixture < NzDemoCascaderDefaultComponent > ;
@@ -1864,10 +1868,12 @@ describe('cascader', () => {
1864
1868
let cascader : DebugElement ;
1865
1869
let testComponent : NzDemoCascaderLoadDataComponent ;
1866
1870
1867
- afterEach ( inject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
1868
- currentOverlayContainer . ngOnDestroy ( ) ;
1869
- overlayContainer . ngOnDestroy ( ) ;
1870
- } ) ) ;
1871
+ afterEach (
1872
+ testingInject ( [ OverlayContainer ] , ( currentOverlayContainer : OverlayContainer ) => {
1873
+ currentOverlayContainer . ngOnDestroy ( ) ;
1874
+ overlayContainer . ngOnDestroy ( ) ;
1875
+ } )
1876
+ ) ;
1871
1877
1872
1878
beforeEach ( ( ) => {
1873
1879
fixture = TestBed . createComponent ( NzDemoCascaderLoadDataComponent ) ;
@@ -2495,9 +2501,9 @@ export class NzDemoCascaderStatusComponent {
2495
2501
`
2496
2502
} )
2497
2503
export class NzDemoCascaderInFormComponent {
2504
+ private fb = inject ( FormBuilder ) ;
2498
2505
validateForm = this . fb . group ( {
2499
2506
demo : this . fb . control < string [ ] | null > ( null , Validators . required )
2500
2507
} ) ;
2501
2508
nzOptions : NzSafeAny [ ] | null = options1 ;
2502
- constructor ( private fb : FormBuilder ) { }
2503
2509
}
0 commit comments