0
任何人都可以请解释滑块指令提供here请给我解释了滑块指令
myApp.directive('slider', function() {
return {
restrict: 'A',
scope: {
ngModel: '='
},
link: function(scope, elem, attrs) {
console.log(scope.ngModel);
return $(elem).slider({
range: "min",
animate: true,
value: scope.ngModel,
slide: function(event, ui) {
return scope.$apply(function(){
scope.ngModel = ui.value;
});
}
});
}
};
});
的ngmodel, range, animate, value:scope.ngModel
等目的一样我看过差不多的一些文章从here但这似乎有点对我来说很复杂。
在此先感谢。