Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit d4fe96f

Browse files
author
Dean Sofer
committed
fix(options): Corrected bug introduced by live-watching the options
1 parent cb660bc commit d4fe96f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sortable.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ angular.module('ui.sortable', []).value('uiSortableConfig',{}).directive('uiSort
1010
link: function(scope, element, attrs, ngModel) {
1111
var onReceive, onRemove, onStart, onStop, onUpdate, opts = {};
1212

13-
attrs.$observe('ui-sortable', function(){
14-
angular.extend(opts, uiSortableConfig, scope.$eval(attrs.uiSortable));
13+
attrs.$observe('ui-sortable', function(newVal){
14+
angular.extend(opts, uiSortableConfig, newVal);
15+
angular.forEach(opts, function(value, key){
16+
element.sortable('option', key, value);
17+
});
1518
});
1619

1720
if (ngModel) {

0 commit comments

Comments
 (0)