For those how have the same issue i managed to do the job this way:
On Page 1 call the page 2 sending the data on the state parameter of the navigationExtras
page 1:
goToPerson(person){
this.router.navigateByUrl("/personProfile", {state:person, replaceUrl:true});
}
On Page 2 subscribing to the queryParams of the activated Route and reading the state parameter of the navigationExtras and using the ionViewWillEnter instead of ngOnInit
page 2:
constructor(private route: ActivatedRoute,private router: Router) {
this.route.queryParams.subscribe(params => {
if (this.router.getCurrentNavigation().extras.state) {
this.person = this.router.getCurrentNavigation().extras.state as Person;
}
});
}
ionViewWillEnter() {
this.person = this.router.getCurrentNavigation().extras.state as Person;
if(this.person.photo != null){
this.photoPerfil = environment.img_url + this.person.photo.fileName;
}else{
this.photoPerfil = "../../../assets/images/person.png";
}
}