Currently, I am exploring the possibilities of integrating AngularJS into my application and have encountered a question regarding the click event implementation.
Within my HTML code:
<div ng-click='clickMe()' ng-controller='testCtrl'>
<img src='test.png'/>
more codes...
</div>
In my controller.js file:
.controller('testCtrl', function(){
$scope.clickMe = function(){
$(this).find('img').attr('src','newImg.png')
}
}
I am seeking assistance on how to effectively utilize the $(this).find()
method in Angular to locate images or other elements. Any insights would be greatly appreciated! Thank you!