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

Filters starting with "_" shouldn't be considered private #4842

Closed
gustavohenke opened this issue Nov 8, 2013 · 14 comments
Closed

Filters starting with "_" shouldn't be considered private #4842

gustavohenke opened this issue Nov 8, 2013 · 14 comments
Assignees

Comments

@gustavohenke
Copy link

Hey,

I've registered Underscore methods as filters, prefixing them with a _. Somewhat like this.

When I had my app running 1.2.0rc3, everything was fine, but today after updating to 1.2.0 they started to throw exceptions telling that I can't access private properties. I'm aware of this change as of 1.2.0, but I don't think filters should follow the same rule.

What could be done about this, any tip/workaround...?

@krotscheck
Copy link

+1 - CouchDB uses a convention where each document id and revision is prefixed with an underscore. Example:

{
    _id: "myDocumentId",
    _rev: "myDocumentRevision"
}

This addition of underscore-as-private makes it impossible to use ngResource and CouchDB.

@tortlieb
Copy link

tortlieb commented Nov 8, 2013

This "error" should be something people do in best practice, and not something that causes your application to fail. Javascript allows me to name my variables anything; don't force your private member variable naming convention on me. How was this not put in any of the release candidates, as this is a code-breaking change?

@gustavohenke
Copy link
Author

@krotscheck this would affect MongoDB users aswell

@devony
Copy link

devony commented Nov 8, 2013

+1 it seems like rc3 files were removed from bower as well so we can't go back

@tortlieb
Copy link

tortlieb commented Nov 9, 2013

I was able to go back to "angular": "1.2.0-rc.3"

@devony
Copy link

devony commented Nov 9, 2013

ahh you're right my resolves were not pointing where i expected

@lucsky
Copy link

lucsky commented Nov 9, 2013

This is most stupid change I've seen in 1.2.

MongoDB and CouchDB use "_id" fields and a few REST APIs that I use allow to embed linked data and return it in an "_embedded" property, to name a few examples of why this should either be reverted alltogether or given a way to be disabled.

@lezhangxyz
Copy link

See #4509 for the main discussion

@goya
Copy link

goya commented Nov 10, 2013

how to repro this issue: use couch or mongo with angular. the outright ridiculousness of this breaking change is beyond belief, i feel we are just being trolled.

@gustavohenke
Copy link
Author

@goya Actually, the problem I've reported is different from the one you guys are reporting.
However, I agree that this should have been done in a RC, so we could have approved/disapproved it before it made into in a final release.

@ghost ghost assigned chirayuk Nov 11, 2013
@christrude
Copy link

+1 this is a big problem with mongoDB. need to use RC3 until this is fixed or all my apps break.

@gwbarrett
Copy link

+1 ditto with MongoDB.

@goya
Copy link

goya commented Nov 13, 2013

fixed in 1.2.1 by #4926 which just added some more bloat.

@gustavohenke
Copy link
Author

Guys... please... this is a issue for NOT considering filters as private.
You should complain about MongoDB/CouchDB issues in #4859 or #4509.

jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
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
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants