Directive link function does not have access to the entire template DOM
问题 I have a directive which has a template that recursively include a template. In my directive link function, I am unable to get the complete DOM with a selector. Here is my directive. Notice that my directive try to call dropdown() function on all .ui.dropdown divs constructed so nested dropdown will be activated. .directive("floatingDropdown", function() { return { restrict: 'E', templateUrl: "scripts/Ui/FloatingDropdown.html", replace: true, scope: { uiClass: '@', model: '=ngModel',