I want to place a tooltip next to a table row in Angular 1.5, similar to something like this: Getting HTML table row position and showing div next to it (but this is jQuery)
I'm trying to pass the table row element to a controller function, but seem unable to access the element.
I've tried:
Template snippet:
<tbody>
<tr ng-repeat="s in sessions"
ng-mouseover="showPopup(this)"
...
Javascript snippet:
$scope.showPopup = function($event) {
console.log(angular.element(this)); // [p]
console.log(angular.element(this).prop('offsetLeft')); // undefined
console.log($event.target); // undefined
console.log(angular.element($event.target).prop('offsetLeft')); // undefined
How can I get the actual coordinates of the table row?
Where [p]
, from console.log(angular.element(this));
above, looks like: