i want to get specific data from json array. and i’m try like this.
alert(JSON.stringify(this.mydata.paymentDate));
i’m right?
here mydata is my json array.
i want to get specific data from json array. and i’m try like this.
alert(JSON.stringify(this.mydata.paymentDate));
i’m right?
here mydata is my json array.
can u explain your question in details so we may know what you exactly want ?
i want to a specific json value from a json array.am attach the json screen shoot and also mark the value.i want to payment date only .how can i do that?
then you can access those value by => this.mydata["MyRoom"].paymentDate
when i used the code that you gave to me .this time showing an error like this.
show me how you write the code ?
there is square bracket used in object
ionViewDidLoad() {
this.storage.get('user_id').then((value) => {
this.user_id=value;
this.http.get("http://www.xxxx.com/demo/append/index.php/myRoom/"+this.user_id)
.subscribe((res:Response)=>{
let dataTemp = res.json();
this.mydata = dataTemp.MyRoom;
alert(this.mydata["MyRoom"].paymentDate)
})
});
}
this.mydata = dataTemp;
alert(this.mydata["MyRoom"].paymentDate)
write this way