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 for truey variables or boolean #26

Open cboden opened 10 years ago

cboden commented 10 years ago

Since promise wrapping has been deprecated in Angular 1.2 it makes less sense to bind promises to the template scope. I would find it easier just to pass a boolean value to cg-busy.

cgross commented 10 years ago

Aren't your ajax calls returning promises? It would seem harder to assign booleans since you'd have to add a then() and set a flag...?

cboden commented 10 years ago

"yes" to both of your questions. I am using a boolean already for other triggers. In addition I do a lot of calculation after my data comes back so I want the cg-busy to stay up longer. I'm currently achieving this by creating a second promise.

muluc commented 10 years ago

Vote +1 :) That would be really helpful to have this option to just pass a boolean

browndp08 commented 9 years ago

I think the benefit of this plugin is in it's simplicity and not needing any flags like @cgross mentioned above. If you want to go the boolean route, why not just use an animated loading icon with ng-show?

Shemesh commented 9 years ago

+1, even more than 1... +5!! i would like to have ability to use both promise and boolean.

anilmujagic commented 8 years ago

+1 for boolean. I have multiple promises active in sub-directives, but I track them in central place using http interceptor, where I have a count of active requests. If that count is > 0, one busy covering the whole main directive should be shown. Only when all of them finish loading the busy directive should disappear.

mzeromski commented 8 years ago

Done in https://github.com/myflowpl/angular-busy2/commit/ab9845ba1a2592f2f05ca3d613f983db9f421675 angular-busy2@4.1.6 node_modules/angular-busy2