Это ответ в формате JSON.
{
"listing": {
"id": "1",
"name": "Institute Name",
"contact": "9876543210",
"website": "http://www.domain.in",
"email": "[email protected]",
"about": "Technical institute",
"products": "PHP, Web, Mobile",
"category_id": "3",
"user_id": "31",
"address": "201,Mumbai, Maharashtra 400051",
"created_at": "2018-02-01 17:18:44",
"updated_at": "2018-04-11 16:28:00",
"listingIcon": "http://res.cloudinary.com/dptwdk7ky/image/upload/v1522756229/test-tube_cfqfmm.png",
"icon": null
}
}
мой HTML код
<ion-content padding>
<ion-card>
<ion-card-header>
{{listing.about}}
</ion-card-header>
<ion-card-content>
The British use the term "header", but the American term "head-shot" the English simply refuse to adopt.
</ion-card-content>
</ion-card>
</ion-content>
Код для вызова api
getListingDetail(id){
this.authService.postData("id = "+id,"list/view").then((result) => {
this.resposeData = result;
//console.info(this.resposeData);
this.listing = this.resposeData.listing;
//this.listings = this.resposeData.data.list.data;
console.info(this.listing);
// localStorage.setItem('userData', JSON.stringify(this.resposeData) )
// this.navCtrl.push(Login);
})
}
Получение ошибки выше .. Помогите пожалуйста. Спасибо.
получение того же JSON в шаблоне



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Изначально список не будет определен из-за характера асинхронных HTTP-вызовов.
Измените свой шаблон на следующий:
{{listing?.about}}
Это известно как оператор безопасной навигации, и он не упадет, если список пуст / не определен. Подробнее об этом можно прочитать здесь: https://angular.io/guide/template-syntax#the-safe-navigation-operator----and-null-property-paths
Можете ли вы попробовать отобразить
listingс помощью{{listing | json}}, чтобы проверить значение листинга в шаблоне