Search code examples
javascriptangularjsrestrestangular

Exclude the restangular functions from received object


How can i Exclude the restangular functions from object i received. Thus here, the properties starting with "addRestangularMethod" should be excluded. If possible, while receiving.

enter image description here


Solution

  • You can exclude all the restangular additional stuff by calling .plain() on your response. The documentation has this:

    plain(): Returns the plain element received from the server without any of the enhanced methods from Restangular. It's an alias to calling Restangular.stripRestangular(elem)