You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I'm trying to render a hierarchical tree recursively using ng-include. Here is a fiddle
The problem is in my link function gets called before the rendering is done to try to initialize a menu plugin on an empty list.
link: function (scope, element, attrs) {
var $menus = element.find("ul");
//Prints empty element
console.log($menus.html());
//No real $menus to initialize
//$menus.menuAim({ });
}
I know there is onload on ng-include, but I don't want to resort to some ugly hack like incrementing a counter on each onload and comparing against count of elements, as calculating the count gets tricky due to the hierarchy structure.
What's a cleaner way to know when the ng-include has finished a full recursive rendering and all elements are on the page?
I tried using postLink instead of link but directive still prints an empty
I'm trying to render a hierarchical tree recursively using ng-include. Here is a fiddle
The problem is in my link function gets called before the rendering is done to try to initialize a menu plugin on an empty list.
I know there is onload on ng-include, but I don't want to resort to some ugly hack like incrementing a counter on each onload and comparing against count of elements, as calculating the count gets tricky due to the hierarchy structure.
What's a cleaner way to know when the ng-include has finished a full recursive rendering and all elements are on the page?
I tried using postLink instead of link but directive still prints an empty
: