本文整理汇总了TypeScript中@angular/router-deprecated.RouteParams类的典型用法代码示例。如果您正苦于以下问题:TypeScript RouteParams类的具体用法?TypeScript RouteParams怎么用?TypeScript RouteParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RouteParams类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private movieData: MovieService,
private params: RouteParams,
private router: Router) {
this.movieData.getById(params.get("id"))
.subscribe(movie => {
this.movie = movie;
});
}
示例2: constructor
constructor(params: RouteParams, ngZone: NgZone) {
var partyId = params.get('partyId');
Tracker.autorun(() => {
ngZone.run(() => {
this.party = Parties.findOne(partyId);
});
});
}
示例3: constructor
constructor(params: RouteParams) {
var partyId = params.get('partyId');
this.party = Parties.findOne(partyId);
let fb = new FormBuilder();
this.partyForm = fb.group({
name: [''],
description: [''],
location: ['']
});
}
示例4: search
search(): void {
this.query = this.routeParams.get('query');
if (!this.query) {
return;
}
this.spotify
.searchTrack(this.query)
.subscribe((res: any) => this.renderResults(res));
}
示例5: ngOnInit
ngOnInit() {
let id: number = +this._routeParams.get('id')
if( id > 0) {
if(!this.contact || this.contact.id != id)
this.contact = this._personService.getById(+id)
} else if(id===-1) {
this.contact = {id: null, firstName: '', lastName: '', email: ''}
this.showEdit = true
}
}
示例6: _initModel
private _initModel(): void {
let endpoint = '/users/' + this._routeParams.get('id')
this._service
.get(endpoint)
.subscribe((user: User) => {
user.birthday = this._datePipe.transform(user.birthday, 'DD/MM/YYYY')
this.model = user
})
}
示例7: ngOnInit
ngOnInit() {
this.chamada = {
'id': null,
'slug': "",
'titulo': "",
'texto': "",
'midia': "",
'aceitaInscricao': false
};
if (this._routeParams.get('slug') != null) {
this.slug = this._routeParams.get('slug');
this._chamadaService.findChamadaBySlug(this.slug).subscribe(res => this.chamada = res);
}
this.captura = { idChamada: null, email: "" };
}
示例8: ngOnInit
ngOnInit() {
let id = +this.routeParams.get('id');
this.service.getMovie(id).then(movie => {
if(movie){
this.editRating = movie.rating;
this.movie = movie;
} else {
this.gotoMovies();
}
});
}
示例9: ngOnInit
// #docregion ngOnInit
ngOnInit() {
let id = +this._routeParams.get('id');
this._service.getCrisis(id).then(crisis => {
if (crisis) {
this.editName = crisis.name;
this.crisis = crisis;
} else { // id not found
this.gotoCrises();
}
});
}
示例10: ngOnInit
ngOnInit() {
let id = +this.routeParams.get('id');
this.service.getShow(id).then(show => {
if(show){
this.editRating = show.rating;
this.show = show;
} else {
this.gotoShows();
}
});
}