angularjsangular-controllerangular-factory

How to use Angular factory data throughout the project


I have an Angular js factory. In which I am storing the user information after successful login. Now I have multiple controllers in all of them I need this user information so I need to inject this factory to each and every controller. Is there any way to access this factory data throughout the project without injecting in each and every controller?

Can we directly inject it into the module?


Solution

  • Some suggestions :