My controller looks like:
$q.all([test1Factory.queryAll().$promise, test2Factory.queryAll().$promise,test3Factory.queryAll().$promise]).then(function(results) {
$scope.testList1 = results[0];
$scope.testList2 = results[1];
$scope.testList3 = results[2];
});
I tried to follow this How to resolve $q.all promises in Jasmine unit tests?
But in my case its give error like
TypeError: 'undefined' is not an object (evaluating 'test1Factory.queryAll().$promise')
$q.all
expects an Array of Promises, and if they aren't Promises they will be considered immediately completed. so I used resources with $promise. I got it from here
Can someone help me how to fix this error.
Thans