© Fu Cheng 2017

Fu Cheng, Build Mobile Apps with Ionic 2 and Firebase, 10.1007/978-1-4842-2737-4_8

8. Manage Favorites

Fu Cheng

(1)Sandringham, Auckland, New Zealand

After adding the user management, we can now move to the next user story that allows users to add stories to their favorites.

Favorites Service

Before we start to implement the favorites service , we need to design the storage structure in the Firebase database. The root path for favorites data will be /favorites. Each user should have its own favorites, so we use the user’s uid as the key for the user’s data. The path for each user’s favorites data is /favorites/${uid}. For each item that the user adds to the favorites, we need to store the item’s id and the timestamp. The timestamp ...

Get Build Mobile Apps with Ionic 2 and Firebase: Hybrid Mobile App Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.