'Placeholder for nz select in ngzorro isn't working
Here is the code snippet. The placeholder doesn't appear in the dropdown, is blank before choosing an option.
<nz-select
nzShowSearch=true
class="preview-dropdown"
[(ngModel)]="selectedValue"
(ngModelChange)="browserSelection($event)"
nzAllowClear
nzPlaceHolder="Choose browser">
<nz-option *ngFor="let browser of browserOptions" [nzValue]="browser.value" [nzLabel]="browser.name"></nz-option>
</nz-select>
Solution 1:[1]
This works for me:
<nz-select
nzSize="large"
formControlName="category"
[(ngModel)]="x.category"
[nzPlaceHolder]="'Select a category'"
>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jeremy Caney |