Skip to content

Instantly share code, notes, and snippets.

@Maqsim
Created February 3, 2014 14:19
Show Gist options
  • Save Maqsim/8784641 to your computer and use it in GitHub Desktop.
Save Maqsim/8784641 to your computer and use it in GitHub Desktop.
Angular Resolves Inside Controller
module.controller('ControllerName', [
'$scope',
'$q',
function (
$scope,
$q
) {
var initResources = function (resources) {
// init after data loading
};
var somePromise = Some.query();
var secondPromise = Second.query({filterObject: {status: 'A'}});
$q.all([somePromise, secondPromise]).then(initResources);
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment