angular-busy icon indicating copy to clipboard operation
angular-busy copied to clipboard

Question: adding other default templates

Open paulflo150 opened this issue 9 years ago • 4 comments

Hi, and thank you for the excellent work! This saved me a lot of work and duplicated code.

How would you go about adding another template to the tracker? What I would like to do is define a global template that gets displayed when my request fails for whatever reason.

Thanks,

paulflo150 avatar Dec 07 '14 18:12 paulflo150

Also, how do you go about accessing the active flag in the view?

This is what I would like to do

active: {{ tracker.active }}

paulflo150 avatar Dec 07 '14 22:12 paulflo150

You want a template to show when the promise fails? There's no feature for that.

As for an active flag, are you talking about in the view meaning the busy template itself or in the view where you're using the directive? Either way there is no flag.

cgross avatar Dec 08 '14 02:12 cgross

Yup, it would be nice to be able to display a default template when the promise fails.

I would be interested in having an active flag (as well as a failed one) in the view where the template is being used - for instance, adding $cgBusyIsActive to the shared scope would expose it, but I am not sure if there would be negative implications to that.

Would you be interested in adding either of these two features (I would be mostly interested in the failed flag where if at least one of the promises fails, this flag would return true)? Until then I will just hack it myself :)

Thanks

paulflo150 avatar Dec 08 '14 03:12 paulflo150

I'm interested to understand the use-case for showing a template when the promise fails? Are you trying to show the user the error? Wouldn't you want to show them the error message and not just some random error image or something?

cgross avatar Dec 08 '14 16:12 cgross