I have two tables: Question
and UserProfile
My database is bring back a list of Question objects and each contains a createdBy which is an integer.
- I have a userProfiles: [] array that contains { id, name } objects
- I have a questions: [] array that contains { id, text, createdBy } objects
Is there some way I could link these two arrays on the client so that when I do a data-ng-repeat to go through the returned list of questions then I can get the name of the user rather than the createdBy
which is just an integer number that references id in the userProfiles
table?
I am just wondering "is this something that people do on the client" or "is this kind of linking always done on the server with a join". For me it seems like a waste to be doing it on the server when I already have an array of [] id, name on the client.