This is a 2-part queastion.
First, I'd like your input as to how you would design the data for these
requirements:
- A user can have multiple lists, every list belongs to just one user
(user <-->>list)
- A list has multiple listItems, and a listItem can belong to multiple
lists (list <<-->>listItem)
- A listItem has multiple listItemLogs, and each listItemLog belongs to
just one listItem (listItem <-->>listItemLog)
Important note: I really doubt that listItemLog should be an object, as
it's just one piece of data - a timestamp as epoch.
users:
/users/$userID/...
Lists:
/lists/$userID/$listID/...
listItems in list:
/listItems/$userID/$listID/$listItemID/true
listItems:
/listItems/$listItemID/...
listItemLogs:
/listItemLogs/$listID/$listItemID/time:true
And second, while taking into consideration the data structure you offer,
how would you merge (in order to display using ngRepeat ) all listItems in
one list, with the logs of the past week (using moment.js to get the epoch
values for weeks start and end is trivial). Note that for performance
reasons, it's probably better to bind only one list's items, and only one
week's logs.
For example, if list "list1" has items "itemA" and "itemB", and itemA was
logged twice on that week, the list should show (in pseudo code) :
list1.title
----------
itemA.name
itemA.logTime1
itemA.logTime2
itemB.name
n/a
I hope the question is clear, and thanks in advance!
P.S.
No problem using the latest versions (currently AngularFire is at 0.92)
--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/849fc803-e6ec-48b0-b922-7f4465a5a035%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.