One of the big issues with using external data services is finding ways to cache data on the client to reduce the number of network calls made during the lifetime of the application. AngularJS actually provides a service that allows you to cache objects on the client. The
$cacheFactory service provides you with the ability to set up a named cache on the client that allows you to save data on the client using named value pairs.
You can provide some simple caching to your data services using the
$cacheFactory service. What you'll need to do in your service is get a reference to the cache instance and then check it prior to making a call to the
mongolab service. When you create a new object in the collection, ...