So, I'm feeling a bit perplexed by this situation. (and maybe I'm missing something obvious but...)
I have 2 consecutive calls to console.log. There is nothing else between them
console.log($state);
console.log($state.current);
and here's an image of the results
Why are the 2 "current" objects different? How is this possible?
Context:
These calls are within an ajax call while resolving route dependencies. Let me know if you need more code or context.
Observed the same issue in Chrome and Firefox
Ajax call and wrapper function (untouched)
normaCtrl.publicNorma = ['$http', '$state', '$stateParams', 'baseUrl', function ($http, $state, $stateParams, baseUrl)
{
var id = $stateParams.id;
return $http.get(baseUrl + "api/public/norma/" + id).then(
function (response) {
console.log($state);
console.log($state.current);
console.log($state.current.title);
return response.data;
}
);
}];
Potential related questions
javascript console.log displays different values on same object
AngularJS: weird console.log behavior with async chrome.storage.local.get()