需要一些帮助,以实现在Ionic中重定向到特定页面的功能。我已经尝试了以下代码示例,但是没有一个对我有用:
this.navCtrl.setRoot(this.flightdetailsPage);
//this.router.navigateByUrl('/flightdetails');
//this.navCtrl.push('flightdetails');
// this.navCtrl.navigateForward("flightdetails");
//this.router.navigate(['flightdetails']);
this.navCtrl.setRoot(this.flightdetailsPage);
//this.router.navigateByUrl('/flightdetails');
//this.navCtrl.push('flightdetails');
// this.navCtrl.navigateForward("flightdetails");
//this.router.navigate(['flightdetails']);
this.navCtrl.setRoot(this.flightdetailsPage);
//this.router.navigateByUrl('/flightdetails');
//this.navCtrl.push('flightdetails');
// this.navCtrl.navigateForward("flightdetails");
//this.router.navigate(['flightdetails']);
答案 0 :(得分:0)
尝试以下格式:
方法1:
this._router.navigate([“ / welcome”],{queryParams:{data:“ name”}});
访问queryParams使用: this.router.snapshot.queryParams [“ data”];
语法:
this.router.navigate([_ path],_data)
方法2:
this._router.navigate(["/welcome", { data: "name" }]);
访问数据:
this.router.snapshot.params["data"]