Skip to content

Commit

Permalink
fix(*): pass right context in case of ctrlAs syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
codef0rmerz committed Dec 26, 2015
1 parent 50b7e23 commit 1f6b7f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/angular-dragdrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var jqyoui = angular.module('ngDragDrop', []).service('ngDragDropService', ['$ti
// call either $scoped method i.e. $scope.dropCallback or constructor's method i.e. this.dropCallback.
// Removing scope.$apply call that was performance intensive (especially onDrag) and does not require it
// always. So call it within the callback if needed.
return (scope[callback] || scope[constructor][callback]).apply(scope, args);
return (scope[callback] || scope[constructor][callback]).apply(scope[callback] ? scope : scope[constructor], args);

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

0 comments on commit 1f6b7f2

Please sign in to comment.