当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript RouteParams.get方法代码示例

本文整理汇总了TypeScript中@angular/router-deprecated.RouteParams.get方法的典型用法代码示例。如果您正苦于以下问题:TypeScript RouteParams.get方法的具体用法?TypeScript RouteParams.get怎么用?TypeScript RouteParams.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/router-deprecated.RouteParams的用法示例。


在下文中一共展示了RouteParams.get方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

 constructor(builder: FormBuilder, private http: Http, private router: Router,
             private routeParams: RouteParams) {
     this.playerId = parseInt(this.routeParams.get('id'));
     this.player = "";
     this.challenging = false;
     this.isAuth = localStorage.getItem('token') != null;
 }
开发者ID:mrvelibor,项目名称:IksOks,代码行数:7,代码来源:view_player.component.ts

示例2: ngOnInit

    ngOnInit() {
		this.orderId = +this.routeParams.get('orderId');
        this.itemId = this.routeParams.get('itemId');
        
        console.info("ItemDetailsSelectionComponent: "
            +"orderId="+this.orderId+" itemId="+this.itemId);
        
        this.orderService.getItemList()
        .then(itemList =>
			{
				this.item = itemList.find(item => item.id == this.itemId);
			} 
		)        
        
		return;        
    }
开发者ID:pavelbt2,项目名称:pizza-node,代码行数:16,代码来源:item-details-selection.component.ts

示例3: constructor

 constructor(routeParams: RouteParams) {
   super();
   var partyId = routeParams.get('partyId');
   this.subscribe('party', partyId, () => {
     this.party = Parties.findOne(partyId);
   });
 }
开发者ID:Hongbo-Miao,项目名称:angular2-meteor-universal,代码行数:7,代码来源:party-details.ts

示例4: ngOnInit

  ngOnInit() {
    let token    = this.params.get("oauth_token");
    let verifier = this.params.get("oauth_verifier");

    if (token && verifier) {
      this.authService.fetchAuthToken(token, verifier).subscribe(data => {
        this.authService.storeToken(data.token);
        this.router.navigate(['Trips']);
      });
      return
    }

    if (this.authService.isLoggedIn()) {
      this.router.navigate(['Trips']);
    }
  }
开发者ID:Joe-noh,项目名称:trav-front,代码行数:16,代码来源:signin.component.ts

示例5: ngOnInit

	ngOnInit(){
		console.log("first step");
		let id = +this.routeParams.get('id')
		console.log(id);
		this.heroService.getHero(id).then(hero => this.hero = hero);

	}
开发者ID:kushalkhera06,项目名称:angular2-poc,代码行数:7,代码来源:hero-detail.component.ts

示例6: ngOnInit

// #enddocregion ctor

// #docregion ng-oninit
  ngOnInit() {
    // #docregion get-id
    let id = +this._routeParams.get('id');
    // #enddocregion get-id
    this._heroService.getHero(id)
      .then(hero => this.hero = hero);
  }
开发者ID:Bigwolfy,项目名称:angular-cn,代码行数:10,代码来源:hero-detail.component.ts

示例7: constructor

 constructor(
     private service: MovieService,
     private router: Router,
     routeParams: RouteParams
 ){
     this.selectedId = +routeParams.get('id');
 }
开发者ID:Valumior,项目名称:MoviesShowsAng2,代码行数:7,代码来源:movie-list.component.ts

示例8: constructor

 constructor(private userService:UserService,
             private params:RouteParams) {
   this.userId = params.get('id');
   this.listProvider = (params) => {
     return userService.listFollowings(this.userId, params);
   };
 }
开发者ID:RechadS,项目名称:angular2-app,代码行数:7,代码来源:following-list.component.ts

示例9: constructor

  constructor(params: RouteParams, private router: Router) {
    super();
    let fb = new FormBuilder();
    var token = params.get('token');

    this.subscribe('invitation', token, () => {
      this.autorun(() => {
        this.invitation = Invitations.findOne({token:token});
        // console.log(this.invitation);
      },   true);
    });

    this.acceptInvitationForm = fb.group({
      // company: ['', Validators.required],
      company: ['test'],
      name: [''],
      last_name: [''],
      email: [''],
      role: [''],
      phone: [''],
      address: [''],
      city: [''],
      state: [''],
      postal_code: [''],
      token: Random.hexString( 16 ),
      invitation_date: [''],
      password: ['']
    });
  }
开发者ID:p3140,项目名称:angular2-meteor-starter-kit,代码行数:29,代码来源:accept-invitation.ts

示例10: ngOnInit

 ngOnInit(){
     let id = Number.parseInt(this._routeParams.get('id'));
     console.log('getting person with id: ', id);
     this._peopleService
       .get(id)
       .subscribe(p => this.person = p);
 }
开发者ID:chaotzu,项目名称:Angular2_1_de_6,代码行数:7,代码来源:person-details.component.ts


注:本文中的@angular/router-deprecated.RouteParams.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。