restangular icon indicating copy to clipboard operation
restangular copied to clipboard

Add configuration option to use plain() by default

Open pleerock opened this issue 12 years ago • 29 comments

I like restangular, but there are some features I dislike. I don't like that restangular appends its own methods to the objects and arrays(!). I know this is one of the principle of restangular, but personally I don't think that its a RIGHT principle.

I like new plain() method you've introduced, but I also would like to see the option to configure it to use it by default, e.g. getList, get methods return promise that will contain already a plain object.

pleerock avatar May 04 '14 11:05 pleerock

Hey,

Thanks for the report, I do think it makes sense :).

I'll mark it as an enhancement :).

Cheers!

mgonto avatar May 30 '14 02:05 mgonto

+1

a8m avatar Jun 11 '14 05:06 a8m

Is plain() supposed to return $$hashKey??

Birowsky avatar Aug 13 '14 12:08 Birowsky

:+1:

flauwekeul avatar Sep 10 '14 12:09 flauwekeul

Would really like this, caused me a ton of confusion. One particular issue is that my getList was returning a post property that was overridden by Restangular's post property.

ncammarata avatar Sep 12 '14 01:09 ncammarata

Agreed. I have tons of plain()'s littering my code.

adhsu avatar Sep 12 '14 23:09 adhsu

+1

kdela avatar Sep 18 '14 07:09 kdela

+2

masscrx avatar Oct 07 '14 11:10 masscrx

+1

nevcos avatar Nov 29 '14 14:11 nevcos

+1

SanthoshMR avatar Dec 08 '14 08:12 SanthoshMR

It could have a feature to only use it in certainly moments, like posting to the server.

sornii avatar Dec 24 '14 18:12 sornii

+1

wibobm avatar Jan 07 '15 19:01 wibobm

+1

chuckweinberger avatar Jan 14 '15 00:01 chuckweinberger

+1

eventures-io avatar Feb 04 '15 09:02 eventures-io

:+1:

I've been (minimally) using this library for 6+ months without realizing the 'big idea' of 'restangularization', which is a very cool idea but surprises you when you look at your $http response and it has all these restangular properties bundled in.

I think that fact should be mentioned in a "Critical/Minimum understanding" section of the README, not because the way it works by default is "wrong", but because people like me will miss out on perhaps the coolest part of the project.

tylercollier avatar Feb 22 '15 07:02 tylercollier

I think that in a MVC application (where there should be a service class responsible for making the CRUD) the "retangularization" doesn't help, instead it creates problems clobbering properties and making debugging more difficult.

I suggest that the "restangularization" should be an option that, If turned off, the object should be clean as it come from the server (without any clobbered properties nor additional methods).

nevcos avatar Mar 25 '15 11:03 nevcos

+1

rafaelmotta avatar May 15 '15 15:05 rafaelmotta

+1

Would be especially useful when having a bunch of conditions on object size sent from server, currently needs a plain() for each of them.

jebarjonet avatar Aug 21 '15 15:08 jebarjonet

+1

Restangular is wonderful but in most of the cases we don't need all the methods. A raw response without unnecessary methods additions will be a very appreciated feature.

marcdexet-cnrs avatar Sep 25 '15 13:09 marcdexet-cnrs

+1

danivaan avatar Oct 28 '15 08:10 danivaan