Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

docs($rootScope): add note about watching File objects #15440

Closed
wants to merge 1 commit into from

Conversation

wesleycho
Copy link
Contributor

  • Add note recommending against watching File objects with deep watchers

This should address #14352

@@ -296,7 +296,7 @@ function $RootScopeProvider() {
* - When `objectEquality == true`, inequality of the `watchExpression` is determined
* 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.
* watching complex objects will have adverse memory and performance implications. This should not be used to watch for objects that are or contain `File` objects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go into its own bullet point, with an explanation why it's not recommended.
Or if it is not recommended because file objects use a lot of memory, then this should also be pointed out.

@Narretz Narretz added this to the Backlog milestone Nov 27, 2016
- Add note recommending against watching `File` objects with deep watchers
@wesleycho
Copy link
Contributor Author

Updated as per request

@@ -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` objects due to limitations with `angular.copy`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a link to angular.copy?

@Narretz Narretz closed this in 9f61e74 Nov 28, 2016
@Narretz
Copy link
Contributor

Narretz commented Nov 28, 2016

Thanks @wesleycho, I've added the link myself. I didn't close the other issue because we should probably add docs to angular.copy itself, maybe a knownIssue for all types that are currently unsupported

Narretz pushed a commit that referenced this pull request Nov 28, 2016
- Add note recommending against watching `File` objects with deep watchers

Closes #15440
ellimist pushed a commit to ellimist/angular.js that referenced this pull request Mar 15, 2017
- Add note recommending against watching `File` objects with deep watchers

Closes angular#15440
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants