I'm using Daniel Crisps AngularJS Range Slider https://github.com/danielcrisp/angular-rangeslider and would like to extend his directive and modify the template.
His directive looks something like this (shortened for space):
angular.module('ui-rangeSlider', [])
.directive('rangeSlider', [
function () {
return {
restrict: 'A',
replace: true,
template: ['<div class="ngrs-range-slider">',
'<div class="ngrs-runner">',
'<div class="ngrs-handle ngrs-handle-min"><i></i></div>',
'<div class="ngrs-handle ngrs-handle-max"><i></i></div>',
'<div class="ngrs-join"></div>',
'</div>',
'<div class="ngrs-value-runner">',
'<div class="ngrs-value ngrs-value-min" ng-show="showValues"><div>{{filteredModelMin}}</div></div>',
'<div class="ngrs-value ngrs-value-max" ng-show="showValues"><div>{{filteredModelMax}}</div></div>',
'</div>',
'</div>'].join('')
}
}
]);
I've been trying to use the suggestion in this question Extending Angular Directive by naming my directive the exact same name (shortened for example):
angular.module('myDirective', [])
.directive('rangeSlider', [
function () {
return {
restrict: 'A',
priority: 500,
template: ['<div></div><div></div>'].join('')
}
}
]);
But am getting the following error: Multiple directives [rangeSlider, rangeSlider] asking for template on:
Has anyone run into this before and how would I go about updating the original template without modifying it in its source?
Edit: Had a an extra ')' in my example.