I agree with Daniel. For more details, see this SO post of mine: http://stackoverflow.com/questions/14206492/how-do-i-store-a-current-user-context-in-angular/14206567#14206567
Josh
(sent from my phone)
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
You should make ample use of angular services they are singletons that you can inject.
Also we do stuff like this in our demo app https://github.com/angular-app/angular-app
Pete
...from my mobile.
--
Yes if you need the data to persist. But even then you should be wrapping them in angular services
Pete
...from my mobile.
What about localStorage and sessionStorage? Those do the exact same thing.
--
I'm don't understand why I should be wrapping localStorage/sessionStorage in an Angular service. Those values are available anywhere simply by referencing them, so why the need to wrap them in Angular? It seems like a lot of unnecessary overhead.
--
I'm not aware of any pre-packaged local storage services, but if you create one, do share. :-)