I tired to get a specific value form an object this is my response
{'status':'200','token':'a9fb451a-8ddc-410a-be8b-b7136284ab96'}
singIn() {
var headers = new Headers();
headers.append("Accept", 'application/json');
headers.append('Content-Type', 'application/json' );
const requestOptions = new RequestOptions({ headers: headers });
let postData = {
"Email": this.username,
"Password": this.password,
}
this.http.post("http://mydomainname/api/user", JSON.stringify(postData))
.subscribe(data => {
console.log(data.status);
}, error => {
console.log(error);
});
}
I want to get token form this repose am tried like this
console.log(data.token) // here showing an error property token dose not exit on type response
console.log(data.status)// its showing 200
please help me out
Thanks