avancement planning
This commit is contained in:
Generated
Vendored
+1
-3
@@ -1,3 +1 @@
|
||||
|
||||
<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions" (ngModelChange)="onChanges($event)"></nz-cascader>
|
||||
|
||||
<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions()" (ngModelChange)="onChanges($event)" />
|
||||
Generated
Vendored
+4
-8
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, OnInit, signal } from '@angular/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { NzCascaderModule, NzCascaderOption } from 'ng-zorro-antd/cascader';
|
||||
@@ -48,12 +48,10 @@ const options: NzCascaderOption[] = [
|
||||
@Component({
|
||||
selector: '<%= selector %>',
|
||||
imports: [FormsModule, NzCascaderModule],
|
||||
<% if(inlineTemplate) { %>template: `
|
||||
<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions" (ngModelChange)="onChanges($event)"></nz-cascader>
|
||||
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
|
||||
<% if(inlineTemplate) { %>template: `<nz-cascader [(ngModel)]="values" [nzOptions]="nzOptions()" (ngModelChange)="onChanges($event)" />`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>
|
||||
})
|
||||
export class <%= classify(name) %>Component implements OnInit {
|
||||
nzOptions: NzCascaderOption[] | null = null;
|
||||
readonly nzOptions = signal<NzCascaderOption[] | null>(null);
|
||||
values: string[] = ['zhejiang', 'hangzhou', 'xihu'];
|
||||
|
||||
onChanges(values: string[]): void {
|
||||
@@ -61,8 +59,6 @@ export class <%= classify(name) %>Component implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
setTimeout(() => {
|
||||
this.nzOptions = options;
|
||||
}, 500);
|
||||
setTimeout(() => this.nzOptions.set(options), 500);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user