-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Strip restangular methods from entries #278
base: master
Are you sure you want to change the base?
Conversation
.oneUrl(view.entity.name(), this.config.getRouteFor(view, entityId)) | ||
.get() | ||
.then(function (response) { | ||
response.data = Restangular.stripRestangular(response.data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can maybe put this in the view.mapEntry
method ?
Restangular methods aren't used on the object himself, we can remove them |
As a matter of fact, my patch doesn't solve #273, because properties named like Restangular methods (like "head") are added then removed, so there is no way to read them. We need a way to prevent Restangular from decorating them in the first place. |
We can't prevent Restangular from decorating, but we can get the original entity by adding a listener (see mgonto/restangular#100 (comment)). Back to WIP. |
e7d8215
to
468cd88
Compare
I've fixed the bug, but there are two drawbacks:
So this needs more work. |
Angular adds its own method to every entity fetched. As they are not namespaced, this has side effects.
I removed them, but I'm not sure we don't use them. @manuquentin, any insight?
Fixes #273