I am getting this error and don’t know why:
this is my code: `<button ion-button color="dark" round full (click)="goToHomePage()">Home Page</button>
<h2>{{NYSEstockData.BA.quote.change}}</h2>
`
In the nyse.html file and in nyse.ts my code is: `import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams } from ‘ionic-angular’;
import { HomePage } from ‘…/home/home’;
import { RestProvider } from ‘…/…/providers/rest/rest’;
/**
- Generated class for the NysePage page.
- See https://ionicframework.com/docs/components/#navigation for more info on
- Ionic pages and navigation.
*/
@IonicPage()
@Component({
selector: ‘page-nyse’,
templateUrl: ‘nyse.html’,
})
export class NysePage {
NYSEstockData: any;
constructor(public navCtrl: NavController, public navParams: NavParams, public restProvider: RestProvider) {
this.getNYSEDataObjectsFromPromise();
}
getNYSEDataObjectsFromPromise(){
this.restProvider.getNYSEDataFromAPIViaPromise().then(data => {
console.log(“Trying to access NYSE results from the Promise return”);
this.NYSEstockData = data;
console.log("Got NYSE results from the Promise");
console.log(this.NYSEstockData);
})
}
ionViewDidLoad() {
console.log(‘ionViewDidLoad NysePage’);
}
public goToHomePage(){
this.navCtrl.push(HomePage);
}
}
`
The thing is when I remove the HTML attempt to render the JSON data I can see the data in the console with no issues. I was able to get something similar working in another project in the home.ts and home.html pages accessing the data in the same way. Any help would be greatly appreciated!