Created
August 5, 2014 20:06
-
-
Save kris/0b1527cf9f258295b6b9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$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