I have a weird problem.
First I retrieve several calls at the same time. And save the returned data in a variable called "values"
function PrefsService($resource,PrefsResource,$q) {
var initialize = function() {
return $q
.all(
[PrefsResource.get({key:"TwentyFourHourTime"}),
PrefsResource.get({key:"DecimalTime"}),
PrefsResource.get({key:"startDayOfWeek"}),
PrefsResource.get({key:"RoundingIncrement"}),
PrefsResource.get({key:"RoundingOption"})
]
)
.then(function(values) {
return values
})
I use this piece of code in controller to see the returned value:
PrefsService
.initialize()
.then(function(values) {
console.log("values",values);
console.log("values[0]",values[0]);
console.log("values[0].result",values[0].result);
})
I want to use "values[0].result" get the result object. But it always gives me a value of "undefined".
Why?
Thx