I'm new to angularjs, and I know there are a lot of questions regarding this error, Unfortunately I couldn't find an answer that fits my problem in any of them.
I've got a factory that holds all the functions, and controllers that use them. in one controller I got a GET function that returns an array, most of my functions are written almost the same, as well as functions that's written exactly the same like this one, only with different variables names/url, but this error occurs only with this function:
Controller:
$scope.getAllFunction = function(){
appServicesProvider.getAll($scope.var1).then(function(res){
$scope.var2 = res;
})
};
Factory (appServicesProvider) :
function getAll(var1){
$http.get(restURL+var1).then(
function(response){
return [].concat(response.data.var2)
}
);
}
As I said, there are more functions that's written exactly the same, only this one won't work, which makes it harder for me to solve. Appreciate any help given!