javascript - Angular.js Illegal invocation on copied File object -


well, there not explain. https://jsbin.com/raqajelufu/edit?html,js,output illegal invocation exception raised on file object property access after being copied angular.copy.

is there workaround, make watching file object possible, considering $watch using angular.copy internally according https://docs.angularjs.org/api/ng/type/$rootscope.scope?

which browser(s) seeing issue on?

a similar question asked while ago concluded could have chrome v43.

some resources related issue:

supposedly, chrome v43 not following in angular.copy source:

var emptyobject = object.create(object.getprototypeof(source)); 

you try of following see if suppresses errors (regardless of browser of choice):

  • dont use angular.copy, avoiding deep watches la $scope.$watch('', fn, true)(jsbin) , go _.clonedeep(jsbin) lodash when need make deep copy of something.
  • step chrome v42 (if on v43).
  • step angular 1.2.28 angular.copy not call above line. source (jsbin)

if want watch avoid angular.copy, (with of lodash.merge):

$scope.$watch(function () {   return _.merge(src, dest); }, callback); 

yet jsbin

that way wouldn't call angular.copy , still have 'deep watch' setup. bare in mind, naive example , have not tested thoroughly think make work angular deep watch minimal effort.


disclaimer: i haven't dug deep going on angular.copy source, console and/or chrome v43. of gray area, above suggestion(s) have yet trigger illegal invocation.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -