Open woaiyan opened 1 year ago
[https://stackblitz.com/edit/ng-zorro-Ntd- ivy-scqx4c?file=src%2FApp.com ivy-SCQX4C? File = src%2FAPP%2FAPP.COMPONENTS)
https://stackblitz.com/edit/ng-zorro-Ntd- ivy-scqx4c?file=src%2FAPPP.CONENTS.TS
You can customize the drop -down content through nzoptions
You can customize the drop -down content through nzoptions
ENVIRONMENT | Info |
---|---|
NG-Zorro-ATD | 11.4.1 |
Browser | Chrome |
Hey if i understand well your needs, you wan to display a custon template for the option of the select component. This is already possible :). The NzOptionComponent have the nzCustomContent. This properties accept a boolean.
If this properties is set to true, the content between the nz-option balise is used as the nzLabel value. If it's false nzLabel value is used. By default the nzCustomContent is set to false.
In your case, you want to use the nzOptions as an input and retrive the value in your custom template. This is not possible for the moment. As a wokaround you can use the first option with NzCustomContent
Reproduction link
https://stackblitz.com/edit/ng-zorro-antd-ivy-scqx4c?file=src%2Fapp%2Fapp.component.ts
Steps to reproduce
https://stackblitz.com/edit/ng-zorro-antd-ivy-scqx4c?file=src%2Fapp%2Fapp.component.ts
What is expected?
可以通过nzOptions自定义下拉内容
What is actually happening?
可以通过nzOptions自定义下拉内容