title: A better way of using providers for static and dynamic global variables
body: <p>I am looking for a better way to store my static and dynamic global variables in my application using angularjs providers.</p>
  
  <p>I have gone through <a href="https://docs.angularjs.org/guide/providers" rel="nofollow noreferrer">this</a> 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.</p>
  
  <p>Below are some of those static variables to make things clear.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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.</p>
  
  <pre><code>Logged in user details(JSON object)
  Customes tree
  Selected Customer(User can change this from tree)
  Competitors(Competitors of selected customer)
  and many more
  </code></pre>
  
  <p>I have also gona through this <a href="https://stackoverflow.com/questions/11938380/global-variables-in-angularjs">stack overflow thread</a> but cant make my choice of which way to go. </p>
  
  <blockquote>
    <p>My question is more in terms of architecture.</p>
  </blockquote>