0
這可能是一個簡單的修復,但我想要做的只是在拖放結束時觸發ng-change。如何僅在指令的拖動結束時觸發ng-change?
之前,我從HTML這樣做直:
<md-slider aria-label="{{ key }}" step="{{ value.step ? value.step : 1 }}" ng-model="filters.lastAppliedFilter.options[key].current" ng-change="filters.applyValue(filters.lastAppliedFilter.name, key, filters.lastAppliedFilter.options[key].current)" min="{{ value.min ? value.min : 1 }}" max="{{ value.max ? value.max : 250 }}"></md-slider>
值從納克重複的到來。
要檢測dragend我創造了這個指令:
'use strict';
angular.module('image.directives').directive('testDragEnd', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.on('$md.dragend', function() {
console.info('Drag Ended');
})
}
}
})
我的問題是我怎麼能觸發NG-變化只在拖動結束?
謝謝。指令的內部