search(): void { this.query = this.routeParams.get('query'); if (!this.query) { return; } this.spotify .searchTrack(this.query) .subscribe((res: any) => this.renderResults(res)); }
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 } }
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 }) }
constructor(private movieData: MovieService, private params: RouteParams, private router: Router) { this.movieData.getById(params.get("id")) .subscribe(movie => { this.movie = movie; }); }
constructor(params: RouteParams, ngZone: NgZone) { var partyId = params.get('partyId'); Tracker.autorun(() => { ngZone.run(() => { this.party = Parties.findOne(partyId); }); }); }
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: "" }; }
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(); } }); }
// #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(); } }); }
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(); } }); }
constructor(params: RouteParams) { var partyId = params.get('partyId'); this.party = Parties.findOne(partyId); let fb = new FormBuilder(); this.partyForm = fb.group({ name: [''], description: [''], location: [''] }); }