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>
How to select dropdown value
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
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
-
- Posts: 449
- Joined: 08 Aug 2018, 14:09
Hi,dinesh1016 wrote: ↑26 Apr 2019, 19:55I 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>
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.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 13 guests