Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template should be customisable #104

Open
jamesjwarren opened this issue Jan 12, 2016 · 3 comments
Open

Template should be customisable #104

jamesjwarren opened this issue Jan 12, 2016 · 3 comments

Comments

@jamesjwarren
Copy link

It would be nice to be able to provide an alternative template for the loading directive.

@cetra3
Copy link
Collaborator

cetra3 commented Feb 9, 2016

Hi @jamesjwarren can you submit a PR for this

@BioPhoton
Copy link

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'

@cetra3
Copy link
Collaborator

cetra3 commented Feb 21, 2016

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;
    });
   }
]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants