I have noticed that there are numerous inquiries on this subject that have already been resolved.
As someone who is new to Angular, I am struggling to grasp the concept of how the {{variable}}
notation actually functions.
When using an API, the response typically looks like this:
data : "MTS-K"
license : "CC BY 4.0 - https://creativecommons.de"
ok : true
stations : Array(3)
0 : {id: "XXX", name: "XXX", brand: "XXX", street: "XXX", place: "YYY"}
1 : {id: "XXX", name: "XXX", brand: "XXX", street: "XXX", place: "YYY"}
2 : {id: "XXX", name: "XXX", brand: "XXX", street: "XXX", place: "YYY"}
__proto__ : Object
The TypeScript code I have written to retrieve this data appears as follows:
this.GasStationProvider.getStations(this.location.lat, this.location.lng).subscribe(
gasStation => {
this.gasStation = gasStation.stations;
});
While my HTML code is structured in this manner:
<p>{{gasStation.stations}}</p>
When rendered, the HTML displays:
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
If you could provide guidance on how I can individually display each line within the station array or direct me to a helpful tutorial, it would be greatly appreciated.
Thank you for your assistance