How to set default value for PrimeNG p-dropdown

后端 未结 8 1128
南笙
南笙 2020-12-09 17:53

I am using PrimeNG in my angular5 app. I have issue with p-dropdown

Question

I have p-dropdown for showing countries. I bind the select opti

8条回答
  •  忘掉有多难
    2020-12-09 18:48

    I just had a similar problem. I solved this with the html attribute "optionLabel". If we read the PrimeNG documentation it says this : Name of the label field of an option when an arbitrary objects instead of SelectItems are used as options.

    Official documentation

    Hope it helps

提交回复
热议问题