angular-slider / angularjs-slider

Slider directive for AngularJS 1.X. No dependencies and mobile friendly.
http://angular-slider.github.io/angularjs-slider
MIT License
1.23k stars 498 forks source link

rzSliderTplUrl should be marked as optional. #668

Open mickdelaney opened 5 years ago

mickdelaney commented 5 years ago

Steps to reproduce

  1. Turn on strict Component Bindings $compileProvider.strictComponentBindingsEnabled(true);
  2. Render an rzslider without setting the rzSliderTplUrl
    
    <rzslider
    rz-slider-model="$ctrl.sliderModel"
    rz-slider-options="$ctrl.sliderOptions">
    </rzslider>

3. 
Error: [$compile:missingattr] Attribute 'rzSliderTplUrl' of 'rzslider' is non-optional and must be set!
https://errors.angularjs.org/1.7.5/$compile/missingattr?p0=rzSliderTplUrl&p1=rzslider
    at angular.js:138
    at strictBindingsCheck (angular.js:11243)
    at initializeBinding (angular.js:11266)
    at forEach (angular.js:395)
    at initializeDirectiveBindings (angular.js:11255)
    at nodeLinkFn (angular.js:10472)
    at angular.js:10900
    at processQueue (angular.js:17914)
    at angular.js:17962
    at Scope.$digest (angular.js:19075)

### Expected behaviour
Tell us what should happen
Given the value is actually optional (there's a default value of 'rzSliderTpl.html'
It should be marked as @? (optional)

### Actual behaviour
Its not optional
ValentinH commented 5 years ago

Hi, I didn't know about strictComponentBindingsEnabled. Would you like to submit a PR fixing this?

mickdelaney commented 5 years ago

Ok, leave it me with.