Hi guys,
I’m using the Ionic select-searchable plugin as I have a massive list of brands that a user can search through. My code at the moment looks like this:
TS code
// Brand
brandList: Brand[] = [];
selectedBrandModel: Brand;
this.http.get(this.singleton.URL_GET_BRANDS, options).map(res => res.json()).subscribe(data => {
for(let tempBrand of data) {
for(let tempSubBrand of tempBrand.Brands) {
this.brandList.push({id: tempSubBrand.id, name: tempSubBrand.name});
console.log("CREATED ID: " + tempSubBrand.id + " W NAME " + tempSubBrand.name);
}
}
console.log(this.brandList);
}, err => {
}, () => {
// this.selectCondition();
});
HTML
<ion-item style="margin-top: 10px">
<select-searchable
#productBrand
title="Brand"
[(ngModel)]="selectedBrandModel"
[items]="brandList"
itemValueField="id"
itemTextField="name"
[canSearch]="true"
(onChange)="change($event)"
>
</select-searchable>
</ion-item>
All followed from the documentation, however, the list just returns empty. Does anyone have any clues as to why this could be happening?