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
Is there a clean way I can know if given object is 'restangularized'? #1280
Comments
AFAIK there's a |
@Vladimir-Purple Does that work for you? |
It looks like this field does not exist anymore. I remember having use it last year. I test now on the function |
@nicolas-zozol This is still available as of the current version of Restangular. The preferred way to do it is actually |
Can you verify for me that it's broken? |
Hi.
Basically, I have situation where I have to know if object passed to the function is restangularized or not, it might be a collection or a single element.
I was thinking about two options.
First option, adding
isRestangularized
boolean property to each response viaRestangularProvider.setResponseExtractor()
However, there is a problem with it, object can 'by pass' intercepter, for instance I can create restangularized element using
Restangular.restangularizeElement()
and it will not contain myisRestangularized
property.As second option, I can look for restangular properties that exist both in collections and elements such as
addRestangularMethod
by doingobject.hasOwnProperty('addRestangularMethod')
check.Is there a better way? (using 1.4.0 version of Restangular)
The text was updated successfully, but these errors were encountered: