0

I have made element directive, which works with template through templateUrl parameter. This template contains fileupload input, which needs about 8 external js libraries (jquery fileupload plugin). If I have links to these js libraries in template (using standard script element), than everything works fine, but there is an error in browser console on loading:

Error: $digest already in progress

If I put the links to js libraries directly to the page, where I have my directive, there is no error, but it is not good way for reusability.

Fabian Schmengler
  • 24,155
  • 9
  • 79
  • 111

1 Answers1

0

Are you trying to trigger a $digest manually?

If this is the case, I strongly recommends you to change the approach, as you should let the Angular decides the best time for a $digest. If it's not possible to change, then you should be sure you're not calling a $digest()/$apply() inside an $digest cycle. One of the ways to do so is ensuring !scope.$$phase.

Caio Cunha
  • 23,326
  • 6
  • 78
  • 74
  • No, i don't use `$digest manually`. I have in directive only one `$http` method, no `$digest` neither any `$timeout`. So it seems that the problem is only in loading external libraries in template. Thanks for response. – user2029387 Feb 01 '13 at 09:03