i am new one so difficult to getting this error using resource module after calling service. can any one modify my mistake in code where i am getting wrong or just modified that
You are getting an object that contain two arrays.
My guess is that in your code before you started with the console.log
outputs, you were setting categories = response;
.
You need to set it to:
categories = response.categories;
Here:
app.controller('itemsFormController', function ($rootScope, $scope, itemService, $location, $cookies, $routeParams) {
itemService.getCategoryAndBrand.TypeGetCategoryAndBrand({}, function(response){
categories = response.categories;
console.log(response);
},function(errorResponse){
console.log(errorResponse);
}
);
});
This might help to understand the problem, also:
AngularJS $resource query returns array with a function in it, which is not does not fit well when iterating through data