I am currently working on a popup directive that is similar to the one found at https://github.com/angular-ui/bootstrap/blob/master/src/modal/modal.js
My goal is to position the popup close to the element that triggered its opening.
What would be the most effective method to achieve this? Could capturing the initiator using ng-click="open($event)" and passing it to the directive be a viable solution? (you can see an example of capturing the element here)
$scope.open= function (e) {
var elem = angular.element(e.srcElement);
}
How can I then pass this angular.element(e.srcElement) to the directive? The directive would need to perform calculations based on the position of the passed DOM element in order to re-position the popup.