angular-recursion
angular-recursion copied to clipboard
Directive Template vs TemplateUrl and Infinite digest
Hi there, I was hoping someone could give me a heads up regarding this issue:
When using an inline template
like in the provided plunker the tree directive works fine. But if I switch the inline template to an html file using templateUrl
I start getting an infinite digest.
- Example using an inline template: Plunker
- Example using html template: Plunker (Throws Infinite Digest)
Can someone explain me why is this happening? Is there a workaround? My template is to complex for using it inline.
Thanks in advance, Leo.
Interested as well. Also, it looks like the issue occurs whether you use RecursionHelper or not (if you comment it out you still get the Infinite Digest)
Well, unfortunately angular-recursion did not solve our problem. We ended up typing inline the recursive directive template, appending and compiling it manually on the directive's link function. Definitively a really hacky way:
element.append(getRecursiveElement());
$compile(element.contents())(scope);
Leo.