Hi, i am able to get data from REST api but in html it show me undefined, i have followed this tutorial to get data
its work fine Ionic Framework : ionic-angular 3.2.1 but with Ionic Framework : ionic-angular 3.3.0 undefined data.
here is my provider method
getHomeData(){
if (this.data) {
return Promise.resolve(this.data);
}
return new Promise(resolve => {
this.http.get(SERVER_NAME+'home')
.map(res => res.json())
.subscribe(data => {
this.data = data;
resolve(this.data);
});
});
}
method in my page typescript
homeData: any;
this.homeService.getHomeData().then(data => {
this.homeData = data;
console.log(this.homeData); // work fine till here but in html its undefined
});
homeData in html is undefined it drive me crazy, i don’t understand where is the problem.