I am currently working with the following provider code:
getWorldCities2() {
return this.http.get('../assets/city.list.json')
.map(res => res.json());
}
Within my TypeScript code, I have implemented the following:
ionViewDidLoad() {
this.getWorldCities();
}
getWorldCities(){
this.AppCitiesProvider.getWorldCities2()
...
}
The HTML page features this structure:
<ion-grid>
<ion-row *ngFor="let row of grid">
<ion-col width-50 *ngFor="let city of row">
{{city}}
</ion-col>
</ion-row>
</ion-grid>
While the code itself works without errors and displays [object Object], I encounter an issue when trying to access a specific property using {{city.name}}. It seems that the view is attempting to resolve 'name' before the observable has set the data.
What would be the correct way to instruct the view to wait for the data?
Thank you.