This is my duyurular.ts file ;
export class DuyurularPage {
duyurular: any;
constructor(public navCtrl: NavController, public navParams: NavParams,
public loadingPage: LoadingController,
platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen)
{
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
var notificationOpenedCallback = (jsonData) => {
this.duyurular = jsonData.notification.payload;
alert(this.duyurular);
};
window["plugins"].OneSignal
.startInit("ASDQWEQWE", "ASDFQW123")
.handleNotificationOpened(notificationOpenedCallback)
.endInit();
});
}
This is my duyurular.html file
<ion-card class="card-background-page" *ngFor="let item of duyurular">
<ion-item>
<ion-avatar item-start>
<img src="./assets/img/avatar.png">
</ion-avatar>
<h2>{{duyurular.title}}</h2>
</ion-item>
<ion-card-content>{{item.body}}</ion-card-content>
I can alert(item.title) but not display duyurular.title in duyurular.html.
What steps should I take to show duyurular.title and duyurular.body on the duyurular.html page?