您的位置:首页 > 其它

ng4 路由多参数传参以及接收

2018-10-04 18:54 381 查看
import { Router } from '@angular/router';

constructor(
private router:Router,
) { }

goApplicationDetail(instanceId:number,ownerShip:boolean){
return this.router.navigate(['/console/details/appDetail',{"instanceId":instanceId,"ownerShip":ownerShip}]);
}
import {ActivatedRoute } from '@angular/router';
constructor(
private route:ActivatedRoute
) {
this.appId = this.route.params["value"].instanceId;
this.tempOwnerShip = this.route.params["value"].ownerShip;
this.tempOwnerShip==="true"?this.ownerShip =true:this.ownerShip =false;
console.log("appid="+this.appId);
console.log("ownerShip="+this.ownerShip);
}

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: