码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-10-04 19:31:00      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:bsp   cto   ram   from   cat   多参数   temp   class   ons   

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 路由多参数传参以及接收

标签:bsp   cto   ram   from   cat   多参数   temp   class   ons   

原文地址:https://www.cnblogs.com/eedc/p/9742836.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!