Attempting to retrieve information from a JSON file has been an issue for me. Here is the code snippet:
ngOnInit() {
this.http.get('assets/json/buildings.json', { responseType: 'text'})
.map(response => response)
.subscribe(result => this.data = result);
console.log(this.data);
}
However, the output I receive is undefined
. I would greatly appreciate some assistance in understanding why my data is not being retrieved successfully.