How to select a child with a specific class name using jqlite in angular js?

Actually angular js does not recommend using jquery for the DOM but it provides basic manipulation using jqlite (extended from jquery with limited operation), but if I want to select a child of the target element, it can be done easily with jquery, but jqlite does not support selector in the children () method. How can I do this using jqlite.

In jquery it is possible

$(this).children('.class_name');

      

But in jqlite this is not possible

angular.element(event.target).children('.class_name');

      

Is there any other way to do this?

+3


source to share


1 answer


You can just use querySelector:

event.target.querySelector('.class_name');

      



As far as I remember, event.target is a DOM element and querySelector is widely supported http://caniuse.com/#search=queryselector

+3


source







All Articles