How To Get $(this) Of JQuery In Angular JS
Posted by blogmeister on
February 19, 2015
Suppose we have this Javascript code using JQuery:
|
1 |
<a href="" onclick="select($(this));">click</a> |
Now we want to get the $(this) object in Angular JS, you can use the $event.target variable in order to do this.
|
1 |
<a href="" ng-click="select($($event))">click</a> |
And within your selecTab method, you can get the reference of $(this) by doing it like this:
|
1 2 3 |
function selectTab(src) { console.log($(src.target)); } |









