As I create an AngularJS directive that is restricted to an attribute, my goal is to manipulate specific child elements of the element.
Currently, I am selecting the elements I need to work with using this method:
var subMenus = angular.element(element.children()[1]);
This approach is risky because it could inadvertently select other unrelated elements.
I have also attempted to select elements with a certain directive:
var subMenus = angular.element('[imp-drop-sub]');
However, this ends up selecting both the desired elements and others with the directive that are not children of the target element.
Is there a selector that allows me to achieve both goals: selecting elements with a specific directive ('imp-drop-menu') but only from the child elements?
While using jQuery is an option, I must accomplish this manipulation within an Angular directive.