Skip to content

Instantly share code, notes, and snippets.

@kris
Created August 5, 2014 20:06
Show Gist options
  • Save kris/0b1527cf9f258295b6b9 to your computer and use it in GitHub Desktop.
Save kris/0b1527cf9f258295b6b9 to your computer and use it in GitHub Desktop.
$scope.lookup = function() {
var path = "api/v1/" + $scope.type + ".json";
var businesses = Restangular.all(path);
var filters = angular.copy($scope.filters);
_.each(filters, function(value, index) {
if (value instanceof Array) {
filters[index + '[]'] = value;
delete filters[index];
}
});
businesses.getList(filters).then(function(businesses) {
$scope.businesses = businesses;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment