export class popOverControlPage{
ps : any;
aa : any;
constructor(public vewCtrl : ViewController, public events : Events, public toastCtrl : ToastController){
this.aa="Yesh ...";
this.events.subscribe("info", (response) =>{
this.aa = response["fdate"];
});
this.ps = this.aa; <--// not Works , not found get dinamyc value. this output : "Yesh ..."
}
}
Or complite source
@Component({
template : `<ion-list>
<ion-list-header>Filter Info</ion-list-header>
<ion-item>{{fdate}}</ion-item>
<ion-item>{{tdate}}</ion-item>
</ion-list>
`
})
export class popOverControlPage{
myObject : any;
myKeys : any;
fdate : string;
tdate : any;
constructor(public vewCtrl : ViewController, public events : Events, public toastCtrl : ToastController){
this.events.subscribe("info", (response) =>{
this.getData(response)
});
}
ionViewDidLoad(){
}
getData(data){
this.myObject = JSON.parse(JSON.stringify(data));
this.myKeys = Object.keys(this.myObject).map(key => ({id : key, value : this.myObject[key]}));
this.fdate = this.myKeys[0].value;
this.tdate = this.myKeys[1].value
}
close(){
this.vewCtrl.dismiss();
}
}
fdate & tdate not work, is null value.