Access to an element from data object


#1

Hello everybody, i don’t know how to access to this object, I tried to get by
Promise.$$state.value.data.access_token but it doesn’t work !
Thank you


#2

Can you provide a codepen with your code?

Or just tell where the object comes from?


#3

i just found the solution, i had to use the then() function like that :smile:
OAuth.getAccessToken(user,options).then(
function (data) {
$localStorage.token= data.data.access_token;
});