title: Can I access MVC web.config values in my angularjs module config method?
body: <p>How do I pass my MVC web.config values to my angular module config method?</p>
  
  <p>I want to set the $logProvider.debugEnabled value with parameter from my MVC web.config. This way I won't have to remember to change the setting as I move from Dev to Test to Prod.</p>
  
  <p>I have <a href="http://anthonychu.ca/post/how-to-pass-webconfig-settings-to-angularjs" rel="nofollow">found a solution</a> for passing parameters that are accessible from my angular controller, but I need them in my config method.</p>
  
  <p>Here is what I have now in my app.js</p>
  
  <pre><code>(function () {
  
      var app = angular.module("myApp", ['configSettings']);
  
      app.config('settings', [function (settings, $logProvider) {
          var envr = settings.serverConfig;
          if (!envr == "LOCAL") {
            $logProvider.debugEnabled(false);
          }
      }]);
  
  }());
  </code></pre>
  
  <p>Thanks in advance,</p>
  
  <p>John</p>