tperrier / mwachx

Mobile SMS management application for maternal health
Apache License 2.0
2 stars 8 forks source link

Fix services for messages and participants to store their own data #241

Closed bderenzi closed 9 years ago

bderenzi commented 9 years ago

Right now they are factories, but we should switch to a service (though I'm not 100% sure it matters)

They should able to fetch and store data so that it can be easily shared between controllers. For more, see:

https://egghead.io/lessons/angularjs-sharing-data-between-controllers

I envision these services acting as a cache. We can implement some sort of cache timeout thing to refresh in case nurses are working concurrently.

An alternative would be to use pusher (https://github.com/pusher/pusher-angular) to send things from the server down to the client directly, but that almost certainly requires building in either a second backend (e.g., something express-based like the pusher docs suggest) or at least a different process (e.g., django-telegraphy). Trying to wire that up with the django-rest-framework seems like zero fun to me.