The TypeError: Illegal invocation
occurs when adding a $watch
with objectEquality
set to true on a model which contains a file(s) property used by ngf-drop
.
Also as reported here.
How can I $watch
the model without getting this error?
Solved without having to use a separate scope variable for the files.
Instead of $watch
ing the model, I $watch
ed a function that returns Json.stringify(model)
-- with objectEquality
true
.
It works, and does not seem to harm perfomance in a user-visible manner.