Created
August 2, 2015 09:29
-
-
Save vpascual/802858c129d8f7ecbca2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('solrExplorerApp') | |
.factory('SolrRequester', function ($q, $http) { | |
return function(queries) { | |
var promises = queries.map( function(file) { | |
var deffered = $q.defer(); | |
$http({ | |
url : file, | |
method: 'GET' | |
}) | |
.success(function(data){ | |
deffered.resolve(data); | |
}) | |
.error(function(error){ | |
deffered.reject(); | |
console.log("Solr returneed error: " + error) | |
}); | |
return deffered.promise; | |
}) | |
return $q.all(promises); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment