Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng-file-upload getting TypeError: Illegal invocation with ngf-drop

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?

like image 261
marco alves Avatar asked Aug 16 '15 12:08

marco alves


1 Answers

I have to say, don't ever try deep watching a complex object, which means:

$scope.$watch('aComplexObject', function(newVal, oldVal) {
    // ...
}, true); // <<< this 'true' may cause the error.
like image 164
kenberkeley Avatar answered Nov 02 '22 12:11

kenberkeley