in angularjs how to access the element that triggered the event?

前端 未结 7 1377
-上瘾入骨i
-上瘾入骨i 2020-12-23 00:19

I use both Bootstrap and AngularJS in my web app. I\'m having some difficulty getting the two to work together.

I have an element, which has the attribute data

7条回答
  •  执念已碎
    2020-12-23 00:56

     updateTypeahead(this)
    

    will not pass DOM element to the function updateTypeahead(this). Here this will refer to the scope. If you want to access the DOM element use updateTypeahead($event). In the callback function you can get the DOM element by event.target.

    Please Note : ng-change function doesn't allow to pass $event as variable.

提交回复
热议问题