tb / ng2-nouislider

Angular2 noUiSlider directive
http://tb.github.io/ng2-nouislider/
MIT License
184 stars 114 forks source link

Allow slider disabled state change by calling RF control disable/enable #149

Closed sharlatta closed 6 years ago

sharlatta commented 6 years ago

Whenever nouislider is used both with formControl directive and disabled attribute we get the following warning: in console:

_It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. We recommend using this approach to avoid 'changed after checked' errors.

  Example: 
  form = new FormGroup({
    first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
    last: new FormControl('Drew', Validators.required)
  });_

The compoennt should support enabling/disabling using reactive forms api control.disable()/control.enable()

sharlatta commented 6 years ago

@tb , please, check whether this can be merged. Appreciate it