Angular is fairly allergic to global variables. I would recommend using a service (e.g. UserDataService
) to hold this data and injecting it where it is needed (like in a controller).
Your service will be a singleton that can be accessed wherever it is injected.