Skip to content

Commit

Permalink
docs($rootScope): add note about watching File objects
Browse files Browse the repository at this point in the history
- Add note recommending against watching `File` objects with deep watchers

Closes angular#15440
  • Loading branch information
wesleycho authored and ellimist committed Mar 15, 2017
1 parent f3bc7c6 commit 5afc122
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ng/rootScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ function $RootScopeProvider() {
* according to the {@link angular.equals} function. To save the value of the object for
* later comparison, the {@link angular.copy} function is used. This therefore means that
* watching complex objects will have adverse memory and performance implications.
* - This should not be used to watch for changes in objects that are
* or contain [File](https://developer.mozilla.org/docs/Web/API/File) objects due to limitations with {@link angular.copy `angular.copy`}.
* - The watch `listener` may change the model, which may trigger other `listener`s to fire.
* This is achieved by rerunning the watchers until no changes are detected. The rerun
* iteration limit is 10 to prevent an infinite loop deadlock.
Expand Down

0 comments on commit 5afc122

Please sign in to comment.