如何更新 angular 服务和指令?

How to update angular service and directives?

我有一个滑块应该与外部网络服务通信,发送和检索数据。 为此,我有一个 JSONP angular 服务和更多由该服务依赖的指令。

当用户拖动滑块时更新服务(用于发送和检索)和指令的方式是什么?

谢谢!

根据你对我评论的回答,我建议使用 AngularJS compatible slider,它与 ng-model 配合得很好。在停止时,您可以访问它的值并发送您的请求,例如:

HTML:

<div ui-slider="{orientation: 'vertical', range: 'min'}"  min="0" max="25" step="1" ng-model="myModel"></div>

控制器代码:

$scope.slider = {
    'options': {
        stop: function (event, ui) { 
           // do your request
        }
    }
}

其他滑块链接:

http://www.nganimate.org/angularjs/ng-switch/slider-css3-transition-animation http://venturocket.github.io/angular-slider/