ngActivityIndicator.js - preloaders for Angular.js apps made easy
Recently I've decided to move a small bunch of code that was used in several of my Angular.js apps into a separate module. That's how appeared ngActivityIndicator.js, find more details on usage under the hood.
This small lib is an Angular provider for loading indicators, which you can use on directives, controllers or services. The most handy piece of it is a directive called ng-activity-indicator which can be used to inject the indicator into the DOM automatically.
Another useful option is a set of 3 built-in CSS preloaders inside. You don't need to worry about the styles anymore, just pick-up the right loader for your app and start using it!
So if you don't need much customized behavior your app master view integration with ngActivityIndicator should be as easy as adding one line of code:
If it feels like not enough styles for you I strongly recommend to take a look at CSS-loaders repository. All of them can be easily integrated into indicator service.
I should also say few words about API. Naming of methods and concept was highly inpired by iOS class named UIActivityIndicatorView, it helps a lot with integrating different styles and simplifies things.
More usage examples and customization options are listed on Github and you can see it in action on this Demo. Happy preloading ;)