ruhley / angular-color-picker

Vanilla AngularJS Color Picker Directive with no requirement on jQuery
http://ruhley.github.io/angular-color-picker/
MIT License
166 stars 79 forks source link

Is there an easy way to change the template? #180

Closed schester44 closed 6 years ago

schester44 commented 6 years ago

Hello, I'm wondering if theres an easy way to change the template without building from source? I've changed the color picker template quite a bit, to the point where updates are no longer feasible; which obviously isn't the best way to go about things. So, whats the best way to change the template?

ruhley commented 6 years ago

@schester44 The html template is put into the angularjs $templateCache - https://github.com/ruhley/angular-color-picker/blob/master/src/scripts/template.js#L2.

You should be able to override the template after loading the angularjs-color-picker.js file either using $templateCache.put() or

<script id="template/color-picker/directive.html" type="text/ng-template">
    <div id="my-picker">
        This is my custom color picker template
    </div>
</script>
ruhley commented 6 years ago

@schester44 I am closing this issue due to inactivity. If you still need help with it then you can re-open this issue.

schester44 commented 6 years ago

That solution will work just fine, thanks for the quick responses!