For each td element in a table I have an attached ng-click. Here is the (simplified) html for each table cell:
-
event.target.closest('td') won't work because event.target is a DOM element and it doesn't have method closest. You need to create a jQuery object to use this method.
Try to find closest td like this:
angular.element(event.target).closest('td')
- 热议问题