angular-recursion icon indicating copy to clipboard operation
angular-recursion copied to clipboard

Directive Template vs TemplateUrl and Infinite digest

Open leonardochaia opened this issue 8 years ago • 2 comments

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.

leonardochaia avatar Mar 17 '16 12:03 leonardochaia

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)

sebastientromp avatar Sep 21 '16 18:09 sebastientromp

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.

leonardochaia avatar Sep 22 '16 14:09 leonardochaia