zoukankan      html  css  js  c++  java
  • 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.appId =
    this.activatedRoute.snapshot.paramMap.get('instanceId');
    
            //this.tempOwnerShip = this.route.params["value"].ownerShip;
         this.tempOwnerShip =
    this.activatedRoute.snapshot.paramMap.get('ownerShip');

    this.tempOwnerShip==="true"?this.ownerShip =true:this.ownerShip =false; console.log("appid="+this.appId); console.log("ownerShip="+this.ownerShip); }
  • 相关阅读:
    hdu1242 Rescue BFS广搜 + 优先队列
    hdu 1430 魔板
    康托展开
    hdu 4394 Digital Square(bfs)
    hdu 1969 Pie
    KMP模板
    hdu 1846 Brave Game
    循环赛日程表
    hdu 1022 Train Problem I
    整数划分问题
  • 原文地址:https://www.cnblogs.com/eedc/p/9742836.html
Copyright © 2011-2022 走看看