I want to create a custom directive (let's call it MyDragSource) that can obtain its "drag context" by calling a function on the scope, like so:
<div my-drag-source drag-context="getDragContext">
In this case, getDragContext is a function that's defined on the scope:
$scope.getDragContext = function() { // return drag source }
I want getDragContext to be lazily invoked when the drag operation begins, not evaluated up front. How can I do this?
In my custom directive, I've tried the following:
$scope.$eval($attrs.dragContext);
However, that doesn't yield the desired result.
()