I am looking for a better way to store my static and dynamic global variables in my application using angularjs providers.
I have gone through this angularjs documentation for providers but it lacks the detailed explanation. I am currently building an application which require static and dynamic sets of global variables which we are planning to use through out our application.
Below are some of those static variables to make things clear.
dateFormat: 'MM/dd/yyyy',
momentDateFromat: 'MM/DD/YYYY',
secondDateFormat: 'MMM d, y',
monthYearDateFormat: 'MMM y',
shortDateTimeFormat: 'short',
mediumDateTimeFormat: 'medium',
inputDebounce: 1000,
searchSymbolsStart: 3,
isDebugLogEnabled: false,
fractionSize: 0,
secondFractionSize: 2,
markerThreshold: 31,
startSelectableDate: startSelectableDate,
endSelectableDate: endSelectableDate
and many more
The dynamic set of global variables are more depends on the customer selection at early stage and are changeable. Below are some of those dynamic variables.
Logged in user details(JSON object)
Customes tree
Selected Customer(User can change this from tree)
Competitors(Competitors of selected customer)
and many more
I have also gona through this stack overflow thread but cant make my choice of which way to go.
My question is more in terms of architecture.