There is a factory
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); }); } } }]); and factory call
itunesSearch.getObj("http://itunes.apple.com/search", $scope.searchParam, "musicVideo", $scope.videoArray, $scope.videoCheck); I can not understand why the parameters:
$ scope.videoArray
$ scope.videoCheck
return undefind