'ng-select - Data not loading correctly according to JSON
I am trying to load drop-down data using the below function. (using ng-select library)
loadBranches() {
this.registrationService.getBranchName().subscribe(data => {
console.log(data);
this.branchModel$ = data['data']['branchArr'];
});
}
Currently, my console log data is loaded correctly. please check the below screenshot:
This is my HTML code.
<ng-select [items]="branchModel$ | async" bindLabel="branchName" required
(change)="getBankInfo($event);" name="branchName" bindValue="title"
placeholder="Select Branch" [(ngModel)]="reserve.branchName">
</ng-select>
but this approach did not work. Can you help me to load this drop-down?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|