How can I find out what's causing a $watch to fire on a scope variable?

187 views Asked by At

I have a lot of input fields (this one is a select box) which can be set in various ways. One in particular has a few static choices (all Strings) and after it is set to the appropriate String, it is inexplicably set to 200. (My only guess at where this is coming from is some HTTP status code or something.)

I can see this happening by adding a $watch on the scope variable.

I know it's a vague question, and I'm happy to provide more details but I'm not sure what would be helpful. But is there a suggested way for debugging where this is coming from? Once the watch is fired, the stack trace isn't very helpful (just going into angular's $digest function) and onReadyStateChange.

0

There are 0 answers