a real-time model factory for syncing cacheable resources in AngularJS