How to select dropdown value

UI Components for Angular
Post Reply
dinesh1016
Posts: 1
Joined: 19 Feb 2019, 06:52

26 Apr 2019, 19:55

I have multiple dropdown like this .Every loop different different status is available. How to select the value ?

<ng-container *ngFor="let res of p.value|keyvalue;let i=index">
<p-dropdown [options]="status_list" placeholder="Status"></p-dropdown>
</ng-container>

quartelh
Posts: 12
Joined: 09 Oct 2018, 11:33

29 Apr 2019, 09:19

You need to bind the dropdown to either an [(ngmodel)] or formControlName (see documentation).

Since you build up your dropdown dynamically I think you are best of with using formControls.
As part of building up the 'p' you also need to create formControls dynamically.

In the template you then assign formControlName to the p-dropdown

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

03 May 2019, 09:37

dinesh1016 wrote:
26 Apr 2019, 19:55
I have multiple dropdown like this .Every loop different different status is available. How to select the value ?

<ng-container *ngFor="let res of p.value|keyvalue;let i=index">
<p-dropdown [options]="status_list" placeholder="Status"></p-dropdown>
</ng-container>
Hi,

You can look this example https://stackblitz.com/edit/github-y1n3fq and you can find more info in https://www.primefaces.org/primeng/#/dropdown .

Best Regards.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests