0
<div id="{{tagid}}" ng-repeat="item in arrItem">
   {{addCompileTag(item)}}
</div>
</code>

In addCompileTag(item) function, I use id of the div tag is "tagid" to $compile HTML DOM inside the div tag, but continually mechanisms $watch called to generate an error.

"Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations"

Help me!

2
  • 1
    I think you need to say a bit more what you are trying to achieve. Your problem seems to be that you are trying to manipulate the DOM generated by angular which is generally a bad idea. The error means the $digest loop never sees things settle down to a stable state. Also remember ng-repeat means you will have several of these divs so you need to give them all their own id (or use a directive to compile the DOM and you won't need an id at all). Commented May 6, 2016 at 13:13
  • You should avoid calling a function, because it gets called over and over. Put some logging in it and a counter, and you will see how many times it gets processed, you would be surprised. There are probably better ways to do, what you are trying to do. Show us some more code. Commented May 6, 2016 at 13:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.