{"action":"created","issue":{"url":"https://api.github.com/repos/mgonto/restangular/issues/1280","repository_url":"https://api.github.com/repos/mgonto/restangular","labels_url":"https://api.github.com/repos/mgonto/restangular/issues/1280/labels{/name}","comments_url":"https://api.github.com/repos/mgonto/restangular/issues/1280/comments","events_url":"https://api.github.com/repos/mgonto/restangular/issues/1280/events","html_url":"https://github.com/mgonto/restangular/issues/1280","id":121922376,"number":1280,"title":"Is there a clean way I can know if given object is 'restangularized'?","user":{"login":"Vladimir-Purple","id":7225681,"avatar_url":"https://avatars.githubusercontent.com/u/7225681?v=3","gravatar_id":"","url":"https://api.github.com/users/Vladimir-Purple","html_url":"https://github.com/Vladimir-Purple","followers_url":"https://api.github.com/users/Vladimir-Purple/followers","following_url":"https://api.github.com/users/Vladimir-Purple/following{/other_user}","gists_url":"https://api.github.com/users/Vladimir-Purple/gists{/gist_id}","starred_url":"https://api.github.com/users/Vladimir-Purple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vladimir-Purple/subscriptions","organizations_url":"https://api.github.com/users/Vladimir-Purple/orgs","repos_url":"https://api.github.com/users/Vladimir-Purple/repos","events_url":"https://api.github.com/users/Vladimir-Purple/events{/privacy}","received_events_url":"https://api.github.com/users/Vladimir-Purple/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mgonto/restangular/labels/waiting%20for%20infos","name":"waiting for infos","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2015-12-13T14:34:47Z","updated_at":"2016-08-31T07:43:22Z","closed_at":null,"body":"Hi.\r\nBasically, 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.\r\n\r\nI was thinking about two options.\r\n\r\nFirst option, adding ```isRestangularized``` boolean property to each response via ```RestangularProvider.setResponseExtractor()```\r\nHowever, 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 my ```isRestangularized``` property.\r\n\r\nAs second option, I can look for restangular properties that exist both in collections and elements such as ```addRestangularMethod``` by doing ```object.hasOwnProperty('addRestangularMethod')``` check.\r\n\r\nIs there a better way? (using 1.4.0 version of Restangular)"},"comment":{"url":"https://api.github.com/repos/mgonto/restangular/issues/comments/243684588","html_url":"https://github.com/mgonto/restangular/issues/1280#issuecomment-243684588","issue_url":"https://api.github.com/repos/mgonto/restangular/issues/1280","id":243684588,"user":{"login":"nicolas-zozol","id":912634,"avatar_url":"https://avatars.githubusercontent.com/u/912634?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-zozol","html_url":"https://github.com/nicolas-zozol","followers_url":"https://api.github.com/users/nicolas-zozol/followers","following_url":"https://api.github.com/users/nicolas-zozol/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-zozol/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-zozol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-zozol/subscriptions","organizations_url":"https://api.github.com/users/nicolas-zozol/orgs","repos_url":"https://api.github.com/users/nicolas-zozol/repos","events_url":"https://api.github.com/users/nicolas-zozol/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-zozol/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T07:43:22Z","updated_at":"2016-08-31T07:43:22Z","body":"Sorry I was wrong. Using Restangular 1.5.2, I have the field `restangularized`. \r\n\r\n![restangularized](https://cloud.githubusercontent.com/assets/912634/18120328/517c3f78-6f5f-11e6-8869-3722c3807dc7.png)\r\n"}}
{"actor":{"display_login":"nicolas-zozol"}}