Skip to content Skip to sidebar Skip to footer

Get Data From The Response

I have a response which is of the below format, I'm not sure how to access .issued , .expires and as:client_id I'm using angular and passing username, password and company_id and

Solution 1:

You can access every property of an object in JavaScript by the indexer syntax, like if it was a map (because an object is a map in javascript):

var issued = response.data[".issued"];
var expires = response.data[".expires"];
var asClient_id= response.data["as:client_id"];

See this link: http://www.w3schools.com/js/js_objects.asp

Accessing Object Properties You can access object properties in two ways:

objectName.propertyName or objectName["propertyName"]

Post a Comment for "Get Data From The Response"