import { Component } from '@angular/core' ; import { ActivatedRoute , Router } from '@angular/router' ; import { ConferenceData } from '../../providers/conference-data' ; @ Component ( { selector : 'page-speaker-detail' , templateUrl : 'speaker-detail.html' , styleUrls : [ './speaker-detail.scss' ] , } ) export class SpeakerDetailPage { speaker : any ; constructor ( private dataProvider , private router , private route ) { } ionViewWillEnter ( ) { this . dataProvider . load ( ) . subscribe ( ( data ) => { const speakerId = this . route . snapshot . paramMap . get ( 'speakerId' ) ; if ( data && data . speakers ) { for ( const speaker of data . speakers ) { if ( speaker && speaker . id === speakerId ) { this . speaker = speaker ; break ; } } } } ) ; } }