title: How to pass variable from app.config() to app.run()
body: <p>I am loading data (idle time and timeout time) from the database via rest api call. From frontend side I am using AngularJs 1.3.1 $http get call to get the data.</p>
  <p>I need the above data (idle time and timeout time) at the app.config() level --- which is working fine.</p>
  <p>I need to pass the same data (idle time and timeout time) from app.config() to app.run(). Any idea how to do that?</p>
  <p>Also how to make sure $http get call is completed and idle time and timeout time is fetched from the database before idle time and timeout time is sent to app.run()?</p>
  <p>I hope people will understand the question and respond to it. I am stuck at it right now.</p>
  <p>code block:</p>
  <pre><code>angular.module().config(function() {
      var idleWarnTime, idleTimeOut;
      var http = angular.injector([ 'ng' ]).get('$http');
      
      http.get('timeout').success(function(response) {
          idleWarnTime = response.data.warntime;
          idleTimeOut = response.data.timeout;
          
      }).error(function(error) {
          console.log('session timeout details fetching from db failed');
      });
  });
  
  
  angular.module().run(function() {
      //need idleWarnTime and idleTimeOut values here and only after &quot;timeout&quot; rest api provide the result
  });
  </code></pre>