-
Notifications
You must be signed in to change notification settings - Fork 27.5k
feat($parse): Custom private field tagging #4859
Conversation
By the way, I've already signed the CLA (is Mary Poppins on holidays?)... I've tried two different approaches to this PR. The first one stored the match pattern into the The actual PR uses the second approach: the pattern is declared on a local variable which defaults to |
For some reason I can't see any commits in the PR... am I underprivileged or is there a missing commit? |
Commit 3d6a89e introduced the concept of private fields that can not be evaluated on an Angular expression. This PR allows changing the matching pattern that tags a field as private. It also allows disabling the private field access restriction. Some examples: ```js myModule.config(function($parseProvider) { // disable private fields restriction $parseProvider.restrictFieldsMatching(null); }); ``` ```js myModule.config(function($parseProvider) { // Now private fields will be those whose identifier // begins with 'priv' $parseProvider.restrictFieldsMatching(/^priv/); }); ``` Custom private field identifiers allow backwards compatibility with AngularJS <1.2 projects that use underscores in scope fields (i.e. data retrieved from a MongoDB instance) while still enjoying the new private field security policy.
Uh! Something strange happened... it was there yesterday! I've just forced the push again, let's see if it's solved now |
Cool. Hopefully this can go into a quick 1.2.1. |
Hiding `_*` properties was a feature primarily for developers using Closure compiler and Google JS style. We didn't realize how many people will be affected by this change. We might introduce this feature in the future, probably under a config option, but it needs more research and so I'm reverting the change for now. This reverts commit 3d6a89e. Closes angular#4926 Closes angular#4842 Closes angular#4865 Closes angular#4859 Closes angular#4849 Conflicts: src/ng/parse.js
Hiding `_*` properties was a feature primarily for developers using Closure compiler and Google JS style. We didn't realize how many people will be affected by this change. We might introduce this feature in the future, probably under a config option, but it needs more research and so I'm reverting the change for now. This reverts commit 3d6a89e. Closes angular#4926 Closes angular#4842 Closes angular#4865 Closes angular#4859 Closes angular#4849 Conflicts: src/ng/parse.js
Commit 3d6a89e introduced the concept of private field that can not be evaluated on an Angular expression for security reasons.
This PR allows changing the pattern that matches a field as private. It also allows disabling the private field access restriction.
Some examples:
Custom private fields allow backwards compatibility with AngularJS <1.2 projects that use underscores in scope fields (i.e. data retrieved from a MongoDB instance) while still enjoying the new private field security policy.
Closes #4509