I'm using AngularJS, AngularUI's jQuery passthrough uiJq and jQuery's noUiSlider plugin, but the question is really about accessing a method. The html portion correctly renders a slider, and I need to 2-way bind to the slider's output value. I tried the below javascript code and variation of them in controller unsuccessfully.
Seems like uiJq doesn't work with all jQuery plugins. I'm wondering if noUiSlider is one that doesn't work and I need to write a custom directive. Also not sure if I need to deal with Deferred Execution or need uiRefresh
to manually $watch
things.
HTML
<div class="noUiSlider" id="abc" ui-jq="noUiSlider"
ui-options="{range: [0, 100], start: 50, handles: 1}"></div>
JS
app.controller('MainCtrl', function ($scope) {
$scope.selectionValue = $('#abc').noUiSlider().val();
// error, seems to override whatever is in html
$scope.selectionValue = $('#abc').val();
// no error but no value is returned
});
Thanks!