Skip to content

Commit 80856ac

Browse files
committed
fix(*): Closes #235 - pass right context in case of ctrlAs syntax
1 parent 388f545 commit 80856ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/angular-dragdrop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var jqyoui = angular.module('ngDragDrop', []).service('ngDragDropService', ['$ti
4747
// call either $scoped method i.e. $scope.dropCallback or constructor's method i.e. this.dropCallback.
4848
// Removing scope.$apply call that was performance intensive (especially onDrag) and does not require it
4949
// always. So call it within the callback if needed.
50-
return (scope[callback] || scope[constructor][callback]).apply(scope, args);
50+
return (scope[callback] || scope[constructor][callback]).apply(scope[callback] ? scope : scope[constructor], args);
5151

5252
function extract(callbackName) {
5353
var atStartBracket = callbackName.indexOf('(') !== -1 ? callbackName.indexOf('(') : callbackName.length,

0 commit comments

Comments
 (0)