hi first time posting to this group, & just trying to get my head around
angular . I have come up against a scenario where the API is returning an
item in JSON like the following:
[{
"tags":["fun","tv"],
"categories":["clothing"],
"id":2,
"properties":[
{"itemId":2,"name":"price","value":"$28","id":5},
{"itemId":2,"name":"image","value":"https://s3-ap-southeast-2.amazonaws.com/watchit-dev/wintergfellblack_100x100.jpg","id":6},
{"itemId":2,"name":"description","value":"Description: Are you a mad-keen fan
of ........","id":7},
{"itemId":2,"name":"name","value":"Winterfell beer Game of Thrones fan
tee","id":8}]
}]
The properties are hasMany relations to the item, but they are all returned in
the same response.
I want to use values from both the top level (ie, tags & categories) and well
as the properties (name & price) when displaying the item.
Is this a common scenario, or should i go back and look at changing whats
returned from the API? Just trying to also think ahead to how modifies are
handled also.
I was thinking that formatters & parsers might be the way to go, but have not
seen anyone approaching this scenario & wanted to air it.
Thanks in advance,
Matt
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.