One issue to watch out for is if you try to send those objects back to the 
server through the rest API, you might have an issue with those new fields 
being sent to your API. Depending on how your back-end is implemented it 
might just ignore the fields, but it could cause errors.

On Tuesday, October 21, 2014 6:41:40 AM UTC-5, Jens Hoffmann wrote:
>
> hello, 
>
> in my application there is a rest api which gets a product object. 
>
> {
>     "Product": {
>         "productId": 181124961,
>         "erpNumber": "1231124",
>         "price": 34.99
>
>     }
> }
>
> My question is now is it ok to extend this model like so, or is it better 
> to create an additional layer for that (wrapper viewmodel): 
>
>
> {
>     "Product": {
>         "productId": 181124961,
>         "erpNumber": "1231124",
>         "price": 34.99,
>         "_chosenOptions": {124214, 1241241}, // own properties marked with 
> "_"
>         "_selectedQuantity": 1
>
>     }
> }
>
>
>
> best regards,
>
> jens
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to