ng-admin
ng-admin copied to clipboard
[WIP] Strip restangular methods from entries
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
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 https://github.com/mgonto/restangular/issues/100#issuecomment-19174352). Back to WIP.
I've fixed the bug, but there are two drawbacks:
- This breaks all tests using Restangular (long and cumbersome to fix)
- This slows down the app, as we have to clone all entries in order
So this needs more work.