src/directive.js
function bindNgModelControls(api) {
      ngModel.$render = () => {
        api.set(ngModel.$modelValue);
      };

      api.on('update', () => {
        const positions = api.get();
        ngModel.$setViewValue(positions);
      });
    }
function bindNgModelControls(api) {
      ngModel.$render = () => {
        api.set(ngModel.$modelValue);
      };

      api.on('update', () => {
        const positions = api.get();
        ngModel.$setViewValue(positions);
      });
    }
Add ngModel controls to the directive. This allows the use of ngModel to set and get the
value in the slider. It uses the noUiSlider API's get and set functions, so no custom
formatters need to be defined for ngModel. The ngModelOptions can be used.

@param {Object} api The API instance returned by the `noUiSlider.create()` method