Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229110

Select item in ionic 2

$
0
0

maybe problem has been resolved, but I can’t get data with {{p.provinceid}} and{{p.name}}.…this is my data, It’s saved localStorage:

{success: true,…}
data{
district
[{districtid: "001", provinceid: "01", name: "Ba Đình"},…]
province
[{provinceid: "01", name: "Hà Nội"}, {provinceid: "02", name: "Hà Giang"},…]
{provinceid: "01", name: "Hà Nội"}
{provinceid: "02", name: "Hà Giang"}
{provinceid: "04", name: "Cao Bằng"}
{provinceid: "06", name: "Bắc Kạn"}
{provinceid: "08", name: "Tuyên Quang"}
{provinceid: "10", name: " Lào Cai"}
{provinceid: "11", name: " Điện Biên"}
{provinceid: "12", name: "Lai Châu"}
{provinceid: "14", name: "Sơn La"}
{provinceid: "15", name: "Yên Bái"}
{provinceid: "17", name: "Hòa Bình"}
}
success true

this is TS file

  province = window.localStorage.getItem('city');
  ionViewDidLoad() {
    this.loadingprovider.showLoader(this);
    let  province = JSON.parse(this.province);
    let dataPro  = province.data.province;
    console.log(dataPro);
    this.profileService.load().subscribe(data => {
      if(data.success==true){
        this.profile = data.data;
        console.log(data);
        this.loading.dismiss();
      }
  },(err)=>{
    this.loading.dismiss();
    })
  }
let  province = JSON.parse(this.province);
    let dataPro  = province.data.province;
    console.log(dataPro);

I can show data with console.log with province array, but I can’t get data from province array, can you help me??

Thanks for the suggestion above <3


Viewing all articles
Browse latest Browse all 229110

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>