I have a few variables (like the current user's state - whether it's authentified or not, etc) that need to be accessible to all my controllers.
I currently have a $rootScope.params.user that does the job. However I have been reading on a few blogs people doing this task by creating a Factory object that they inject to each controller where it's required. My approach seems less verbose though as I just need to declare the variable once. What is the best approach in term of performance? Are there downsides I'm missing in any of them? -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/groups/opt_out.
