How to set default value for PrimeNG p-dropdown

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

    Try to replace

    this.applicant.country = 'India';
    

    with

    this.applicant = {country: 'India'};
    

    Edit

    Display your p-dropdown once you got the data from your API.

    See Plunker

提交回复
热议问题