I have a component using an Ionic modal to modify the album variable.
addMedias() {
let self = this;
let profileModal = self.modalCtrl.create(AlbumAddPage, { album: self.album });
profileModal.onDidDismiss(data => {
self.zone.run(() => {
console.log("ALBUM " + data.album)
self.album = data.album;
})
});
profileModal.present();
}
I tried to force change detection with ChangeRefDetector
markForCheck()
and detectChanges()
, then I tried to use angular Zones, but when onDidDismiss()
is called, the view of this component does not update.
Any thoughts ?
EDIT : here is the modal code :
@Component({
selector: 'page-album-add',
templateUrl: 'album-add.html'
})
export class AlbumAddPage {
album: any;
constructor(
private navParams: NavParams,
public navCtrl: NavController,
private viewCtrl: ViewController,
) {
this.album = navParams.data.album;
}
addMedias(asset){
this.album.assets.push(asset);
this.viewCtrl.dismiss({album:this.album});
}
}