Skip to content

Instantly share code, notes, and snippets.

@icfantv
Created April 22, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icfantv/a92364f724a222094a5e4e97c8964a15 to your computer and use it in GitHub Desktop.
Save icfantv/a92364f724a222094a5e4e97c8964a15 to your computer and use it in GitHub Desktop.
Resolve Function
{
resolve: {
foo: ['$q', 'ModalService', 'MyService', ($q, ModalService, MyService) => {
return $q.resolve(ModalService.open()
.then(() => {
console.log('modal resolved');
return MyService.doSomething(someData);
})
.catch((error) => {
console.log('rejected');
return $q.reject(error);
})
.finally(() => ModalService.close()));
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment