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
?
Some suggestions :
localStorage
or sessionStorage
to store the user information. So, that without injecting you can easily access stored storage value everywhere you want.