I am fairly new to Angular (coming from a .net C# background). I have been looking for a pretty clean loading pattern and yours looks like its well conceived and built. The one question I had is that I'd like to to manipulate the inner contents of sw-is-loading-spinner vs just doing a straight css solution. How would you recommend going about that? Would I just create a directive? Appreciate it!
Oh interesting. Are you saying that you'd like to provide your own component to act as the loading spinner? Currently that's not a supported feature, but I think it would be easy to add. If you open a feature request in the repo, I might be able to do it this week. I think all that would need to happen is update ISWIsLoadingDirectiveConfig to accept a spinner component class and then have IsLoadingDirective use that instead of the default IsLoadingSpinnerComponent.
Initially I was thinking it'd be nice to have it inject my own component as I want contemplating some more context-specific logic to adjust spinner size and animations to use if its a button (and then some logic branching if its an icon button vs non-icon) or just some random div. Perhaps the config could have an optional IsLoadingSpinnerComponent where I could just reference my own component.
I ended up getting 99% of the way there using CSS and just having very specific selector patterns to branch logic so its not a huge deal but I can enter a feature request in the repo. Thanks!
I am fairly new to Angular (coming from a .net C# background). I have been looking for a pretty clean loading pattern and yours looks like its well conceived and built. The one question I had is that I'd like to to manipulate the inner contents of sw-is-loading-spinner vs just doing a straight css solution. How would you recommend going about that? Would I just create a directive? Appreciate it!
Oh interesting. Are you saying that you'd like to provide your own component to act as the loading spinner? Currently that's not a supported feature, but I think it would be easy to add. If you open a feature request in the repo, I might be able to do it this week. I think all that would need to happen is update
ISWIsLoadingDirectiveConfig
to accept a spinner component class and then haveIsLoadingDirective
use that instead of the defaultIsLoadingSpinnerComponent
.Initially I was thinking it'd be nice to have it inject my own component as I want contemplating some more context-specific logic to adjust spinner size and animations to use if its a button (and then some logic branching if its an icon button vs non-icon) or just some random div. Perhaps the config could have an optional IsLoadingSpinnerComponent where I could just reference my own component.
I ended up getting 99% of the way there using CSS and just having very specific selector patterns to branch logic so its not a huge deal but I can enter a feature request in the repo. Thanks!
FYI in case you missed it, I replied to the feature request you opened with a followup question.