Template should be customisable
It would be nice to be able to provide an alternative template for the loading directive.
Hi @jamesjwarren can you submit a PR for this
Could you just change the template setting to templateUrl in the directive part? Then it would be easy to override the default template and implement custom once.
I guess this change is too small for a PR but would help many people! :-)
https://github.com/VictorBjelkholm/ngProgress/blob/master/src/directive.js#L35
template: '<div id="ngProgress-container"><div id="ngProgress"></div></div>'
to
templateUrl:'ngProgress/template.html'
I would say it should be configurable per instance, rather than a hardset value. Then when changing the instance config, you have a chance to change it.
Otherwise, you can use the provide decorator to do what you asked:
angular.module('myModule', ['ngProgress'])
.config(['$provide', function($provide) {
$provide.decorator('ngProgressDirective', function($delegate) {
var directive = $delegate[0];
directive.template = '<div id="ngProgress-container"><div id="ngProgress"></div></div>';
return $delegate;
});
}
]);