Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Directive isolate scope '=' with JSON in DOM causes $digest to reach max iterations. (But will parse the JSON) #4054

Closed
bobslaede opened this issue Sep 19, 2013 · 3 comments

Comments

@bobslaede
Copy link

Having a directive run on the following html, and trying to to get the JSON object from the attribute breaks.
<foo bar='{"foo":"bar"}'></foo>
The JSON is extracted, but it throws Uncaught Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting!

Example bin: http://jsbin.com/UKOMuZi/13/edit

I'm not sure what should happen, either it shouldn't work, and then error, or it should keep working, but not throw an error.

@petebacondarwin
Copy link
Contributor

Duplicate of #3980

@justinmc
Copy link

justinmc commented Feb 5, 2014

I'm getting this same problem in v1.2.3, even though the duplicate referenced says it's fixed. The workaround provided also seemed to not apply to this case...

@caitp
Copy link
Contributor

caitp commented Feb 5, 2014

This seems like it shouldn't be an issue, because the watcher should be unregistered if it determines the object is a constant. What's going on with that?

@petebacondarwin, looking at #3980, I'm not sure this actually was a duplicate. There's no filter in the reproduction, so the parser should tell us it's a constant and the watch should be unregistered.

However, this does appear to have been fixed a while ago, I don't feel like bisecting to find the specific commit, but it's been dealt with, probably 43072e3 (so @justinmc, you should be okay with 1.2.5 or higher)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants