title: how to define constants for Angular JS in a different file
body: <p>I want to write several constants for my Angular JS app. I want to write them in a separate file and want to access them.</p>
  
  <p>I have tried with IIFE (Immediately Invoked Function Expression) like this,</p>
  
  <p><strong>constants.js</strong></p>
  
  <pre><code>var Constants = (function () {
  
      var allConstants = {
          "url": 'abc',
          "name": "anijit",
          "sn": "sau"
      }
  
      return allConstants
  })();
  console.log('defined constants', Constants)
  </code></pre>
  
  <p>But when I have tried to access them it show <code>Constants not defined</code> error. Where I have done the wrong thing? </p>
  
  <p>I want to access them using <code>Constants.url</code> in the way and I don't want to make any <code>$http</code> call or something like that. How to achieve that?</p>