Есть фабрика
appModule.factory('search', ['$http', function($http) {
return {
getObj: function(url, termParam, entity, array, checkParam) {
$http.jsonp(url, {
params: {
"callback": "JSON_CALLBACK",
"term": termParam,
"limit": 25,
"entity": entity
}
}).success(function(data, status, headers, config) {
array = data.results;
if (array.length == 0) {
checkParam = false;
} else {
checkParam = true;
}
}).error(function(data, status, headers, config) {
console.log("error" + data);
});
}
}
}]);
и вызов фабрики
itunesSearch.getObj("http://itunes.apple.com/search", $scope.searchParam, "musicVideo", $scope.videoArray, $scope.videoCheck);
Не могу понять, почему параметры:
$scope.videoArray
$scope.videoCheck
возвращают undefind