Created
February 5, 2014 15:32
-
-
Save robwormald/8826141 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
blas.queryAndGroup = function (permissions) { | |
var deferred = $q.defer() | |
// load accounts from backend and group by owner | |
var foobar = $resource( | |
'/api/accounts', { | |
}, { | |
query: { | |
method: 'GET', | |
isArray: true, | |
cache: true | |
} | |
} | |
} | |
); | |
foobar.query().then(function(datas){ | |
//filter your data in here | |
var filtered = $filter('filtername')(arg1,arg2); | |
then resolve the promise w/ the filterd data | |
return deferred.resolve(filtered) | |
}) | |
//return your own promise | |
return deferred; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment