I have an angular application In that I have to populate the dropdown list based on picklist values.
.component.html
<div class="row">
<div class="form-group">
<div class="col-sm-3">
<label for="action"> <b>Category</b></label>
</div>
<div class="col-sm-7">
<select>
<option value="" disabled [selected]="true"></option>
<option>Billing</option>
<option>other</option>
<option>action</option>
</select>
</div>
</div>
</div>
<select class="form-control" name="drpAction" id="actionSelect1ID"
(change)="actionSelect($event.target.value)" [(ngModel)]="actionStatusTypeID">
<option *ngFor="let code of memberContactCodes; let mIdx = index" [value]="mIdx">
{{code.Name}}
</option>
</select>
<select class="form-control" name="drpAction" id="billingActionId"
(change)="billingSelect($event.target.value)" [(ngModel)]="billingActionId">
<option *ngFor="let code of billingActionCodes; let mIdx = index" [value]="mIdx">
{{code.Name}}
</option>
</select>
<select class="form-control" name="drpAction" id="otherActionId"
(change)="otherSelect($event.target.value)" [(ngModel)]="otherActionId">
<option *ngFor="let code of otherActionCodes; let mIdx = index" [value]="mIdx">
{{code.Name}}
</option>
</select>
</div>
</div>
</div>
.component.ts
public billingSelect(data: any) {
this.billingActionId = data;
}
public otherSelect(data: any) {
this.otherActionId = data;
}
public actionSelect(data: any) {
this.actionStatusTypeID = data;
}
.service.ts
let baseUrl = `/endpoint`;
this._restfulService
.restfulGetData(baseUrl)
.subscribe(
(actionLookupData: ActionLookupData) => {
if (actionLookupData) {
this.memberContactCodes = actionLookupData.MemberContactCodes;
this.referralCodes = actionLookupData.ReferralCodes;
this.otherActionCodes = actionLookupData.OtherActionCodes;
this.billingActionCodes = actionLookupData.BillingActionCodes;
}
},
(err) => {
console.error(err);
}
);
}
So here my requirement is to show the dropdown based on the picklest values(Billing,other,action) Butin the above code it is showing the 3 dropdowns for action But I have to show only one dropdown for action, but based on the selection of picklists I have to show the dropdown lists.
Can anyone help me on this
