How to set default value for PrimeNG p-dropdown

后端 未结 8 1127
南笙
南笙 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:51

    Update in PrimgNg

    While setting default value for dropdown in Primeng need to be little careful.

    
    

    country should be a number not string.

    You can typecast it, if it is a string.

    country: Number("1");
    

提交回复
热议问题