本文整理汇总了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;
}
示例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;
}
示例3: constructor
constructor(routeParams: RouteParams) {
super();
var partyId = routeParams.get('partyId');
this.subscribe('party', partyId, () => {
this.party = Parties.findOne(partyId);
});
}
示例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']);
}
}
示例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);
}
示例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);
}
示例7: constructor
constructor(
private service: MovieService,
private router: Router,
routeParams: RouteParams
){
this.selectedId = +routeParams.get('id');
}
示例8: constructor
constructor(private userService:UserService,
private params:RouteParams) {
this.userId = params.get('id');
this.listProvider = (params) => {
return userService.listFollowings(this.userId, params);
};
}
示例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: ['']
});
}
示例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);
}