angular.module("ng-context-menu",[]).factory("ContextMenuService",function(){return{element:null,menuElement:null}}).directive("contextMenu",["$document","ContextMenuService",function(e,n){return{restrict:"A",scope:{callback:"&contextMenu",disabled:"&contextMenuDisabled"},link:function(t,l,o){function u(n,t){t.addClass("open");var l=e[0].documentElement,o=(window.pageXOffset||l.scrollLeft)-(l.clientLeft||0),u=(window.pageYOffset||l.scrollTop)-(l.clientTop||0),c=t[0].scrollHeight,i=l.clientHeight+u,a=c+n.pageY,d=Math.max(n.pageY-u,0);a>i&&(d-=a-i),t.css("top",d+"px"),t.css("left",Math.max(n.pageX-o,0)+"px"),m=!0}function c(e){e.removeClass("open"),m=!1}function i(e){!t.disabled()&&m&&27===e.keyCode&&t.$apply(function(){c(n.menuElement)})}function a(e){t.disabled()||!m||2===e.button&&e.target===n.element||t.$apply(function(){c(n.menuElement)})}var m=!1;l.bind("contextmenu",function(e){t.disabled()||(null!==n.menuElement&&c(n.menuElement),n.menuElement=angular.element(document.getElementById(o.target)),n.element=e.target,console.log("set",n.element),e.preventDefault(),e.stopPropagation(),t.$apply(function(){t.callback({$event:e}),u(e,n.menuElement)}))}),e.bind("keyup",i),e.bind("click",a),e.bind("contextmenu",a),t.$on("$destroy",function(){e.unbind("keyup",i),e.unbind("click",a),e.unbind("contextmenu",a)})}}}]);
angular.module("ng-context-menu",[]).factory("ContextMenuService",function(){return{element:null,menuElement:null}}).directive("contextMenu",["$document","ContextMenuService",function(e,n){return{restrict:"A",scope:{callback:"&contextMenu",disabled:"&contextMenuDisabled"},link:function(t,l,o){function u(n,t){t.addClass("open");var l=e[0].documentElement,o=(window.pageXOffset||l.scrollLeft)-(l.clientLeft||0),u=(window.pageYOffset||l.scrollTop)-(l.clientTop||0),c=t[0].scrollHeight,i=l.clientHeight+u,a=c+n.pageY,d=Math.max(n.pageY-u,0);a>i&&(d-=a-i),t.css("top",d+"px"),t.css("left",Math.max(n.pageX-o,0)+"px"),m=!0}function c(e){e.removeClass("open"),m=!1}function i(e){!t.disabled()&&m&&27===e.keyCode&&t.$apply(function(){c(n.menuElement)})}function a(e){t.disabled()||!m||2===e.button&&e.target===n.element||t.$apply(function(){c(n.menuElement)})}var m=!1;l.bind("contextmenu",function(e){t.disabled()||(null!==n.menuElement&&c(n.menuElement),n.menuElement=angular.element(document.getElementById(o.target)),n.element=e.target,e.preventDefault(),e.stopPropagation(),t.$apply(function(){t.callback({$event:e}),u(e,n.menuElement)}))}),e.bind("keyup",i),e.bind("click",a),e.bind("contextmenu",a),t.$on("$destroy",function(){e.unbind("keyup",i),e.unbind("click",a),e.unbind("contextmenu",a)})}}}]);

Update ng-context-menu.min.js