Skip to content

Commit

Permalink
refactor(module:auto-complete): migrate to new control flow (#8662)
Browse files Browse the repository at this point in the history
  • Loading branch information
HyperLife1119 authored Aug 3, 2024
1 parent d347719 commit bdb7311
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/auto-complete/autocomplete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { AnimationEvent } from '@angular/animations';
import { Direction, Directionality } from '@angular/cdk/bidi';
import { NgClass, NgFor, NgStyle, NgTemplateOutlet } from '@angular/common';
import { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
import {
AfterContentInit,
AfterViewInit,
Expand Down Expand Up @@ -66,7 +66,7 @@ function normalizeDataSource(value: AutocompleteDataSource): AutocompleteDataSou
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [NgClass, NgFor, NgStyle, NgTemplateOutlet, NzAutocompleteOptionComponent, NzNoAnimationDirective],
imports: [NgClass, NgStyle, NgTemplateOutlet, NzAutocompleteOptionComponent, NzNoAnimationDirective],
template: `
<ng-template>
<div
Expand All @@ -91,9 +91,11 @@ function normalizeDataSource(value: AutocompleteDataSource): AutocompleteDataSou
<ng-content></ng-content>
</ng-template>
<ng-template #optionsTemplate>
<nz-auto-option *ngFor="let option of normalizedDataSource" [nzValue]="option.value" [nzLabel]="option.label">
{{ option.label }}
</nz-auto-option>
@for (option of normalizedDataSource; track option.value) {
<nz-auto-option [nzValue]="option.value" [nzLabel]="option.label">
{{ option.label }}
</nz-auto-option>
}
</ng-template>
</ng-template>
`,
Expand Down

0 comments on commit bdb7311

Please sign in to comment.