Hello,
This is my otpProvider.ts
export class OtpproviderProvider {
phone:any;
institute:any;
constructor(public http: HttpClient) {
console.log(‘Hello UserProvider Provider’);
}
apiUrl=‘http://122.166.234.42:821/requestotp.php’;
getUsers(phonenumber,institute)
{
this.phone=phonenumber;
this.institute=institute;
console.log(this.phone);
return new Promise(resolve =>{
this.http.get(this.apiUrl+’/’+‘phone’+’=’+this.phone+‘institute’+’=’+this.institute).subscribe(data =>{
resolve(data);
},err => {
console.log(err);
});
});
}
}
and this is my institute.ts
constructor(public navCtrl: NavController, public navParams: NavParams,public userProvider:UserProvider,public alertCtrl: AlertController,public otpProvider:OtpproviderProvider) {
this.num=navParams.get(‘data’);
this.userProvider.getUsers(this.num).then(data =>{
this.instituteArray=data;
console.log(‘Institute Details are’+JSON.stringify(this.instituteArray));
});
}
I am sending Http request and getting response [{“status”:“success”}] in json…from this json how can i get the value of status???
please help…
Thanks