Hello everyone!
I´m new to ionic and at the moment I´m trying to communicate between Pages. I want to share an Object depending on the User Interaction.
I found the Docu about Handling events in Ionic and now I´m trying to publish Data in one page to the other:
openPage(page) {
this.nav.setRoot(page.component);
this.events.publish('channel:changed', page)
}
In the Other Page I´m subscribing to this Event:
public channel: any = {}
constructor(public navCtrl: NavController, public events: Events) {
events.subscribe('channel:changed', (channel) => {
this.channel = channel
console.log(this.channel)
})
}
Until here everthing work fine!
But now i want to display the Title of the channel in the HTML File
<ion-header>
<ion-navbar>
<button ion-button menuToggle>
<ion-icon name="menu"></ion-icon>
</button>
<ion-title>{{ channel.title }}</ion-title>
</ion-navbar>
</ion-header>
But no title is displayed…
Can anyone help me?