ng4 路由多参数传参以及接收
Posted eedc
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ng4 路由多参数传参以及接收相关的知识,希望对你有一定的参考价值。
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); }
以上是关于ng4 路由多参数传参以及接收的主要内容,如果未能解决你的问题,请参考以下文章