Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

How to get json data to variable?

$
0
0

@birolcaglar97 wrote:

Im trying to get my json data to array and i need to control it how can i do that can u guys please help me ?

  login()
  {
    let hash = CryptoJS.SHA256(this.user_password).toString(CryptoJS.enc.Hex);
    let data:Observable<any>;
    data = this.http.get('localhost/api/?loginUn='+this.user_name+'&password='+hash);
    data.subscribe(result=>
      {
        this.items = result;
      })
    if(this.items['state'] == "yes")
    {
      console.log("data");
    }
    else
    {
      console.log(this.items);
      console.log("no data");
    }
  }

json data

{"state":"yes"}

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



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