cgross / angular-busy

Show busy/loading indicators on any element during $http requests (or any promise).
http://cgross.github.io/angular-busy/demo
MIT License
1.44k stars 256 forks source link

Allow advanced version to accept a promise, or something that has a .promise or .$promise #102

Open mtpultz opened 7 years ago

mtpultz commented 7 years ago

Of the two options to pass to cg-busy is it possible to have the advanced version to expect a promise (or something that has a .promise or .$promise similar to the simple version. That would allow the use of $q.defer() in the advanced version, and an easy invocation to either resolve or reject, for example:

// Controller
vm.busy = {
    promise: $q.defer(),
    templateUrl: 'something.html',
    message: '...',
    backdrop: false
}

// Template
<div cg-busy="vm.busy"></div>
plantsmiles commented 7 years ago

+1

tiberiuzuld commented 7 years ago

Hi @mtpultz implemented your desired modifications from this post https://github.com/cgross/angular-busy/issues/102 into my fork. https://github.com/tiberiuzuld/angular-busy