title: Set global constants in AngularJs
body: <p>I am trying to create constants js file in angular js for an application.  I am using below code to implement constants for entire application. It's working fine.</p>
  
  <pre><code>&lt;code&gt;
  // app.js
  angular.module('myApp', [
          'ngCookies',
          'ngResource',
          'ngSanitize',
          'ngRoute'
      ])
      .constant('config', {
          mySetting: 42
      })
      .config(function ($routeProvider) {
          $routeProvider
              .when('/', {
                  templateUrl: 'views/main.html',
                  controller: 'MainCtrl'
              })
              .otherwise({
                  redirectTo: '/'
              });
      });
  &lt;/code&gt;
  </code></pre>
  
  <p>My concern is in app.js file I want to write only routing, for constants I want to write separate file and I will call same file for all the controllers in my application. </p>
  
  <p>For entire application might be 200+ constants I want to declare, so I want to make it is separate file or split constants file for controllers wise.</p>
  
  <p>Please guide me which way is easy for maintenance.</p>
  
  <p>Thanks in advance </p>