jQuery find() method not working in AngularJS directive

前端 未结 7 1003
说谎
说谎 2021-01-31 14:26

I am having trouble with angularjs directives finding child DOM elements with the injected angular element.

For example I have a directive like so:



        
7条回答
  •  心在旅途
    2021-01-31 15:09

    find() - Limited to lookups by tag name you can see more information https://docs.angularjs.org/api/ng/function/angular.element

    Also you can access by name or id or call please following example:

    angular.element(document.querySelector('#txtName')).attr('class', 'error');
    

提交回复
热议问题