title: How to `inject` `$window` object to the `config` in AngularJS
body: <p>I am trying to inject the <code>$window</code> object into the <code>config</code> method in AngularJS, but I keep getting an error...</p>
  
  <p>What is the correct way to do this?</p>
  
  <p>Here is my code :</p>
  
  <pre><code>angular.module('myApp', ['$window']) //is this wrong?
  
    .config(function ($window) { //this is not the way?
        console.log($window); //console.log fails //error
    })
  
    .controller("main", function($scope) {
      $scope.index = 0;
      $scope.num = number[$scope.index];
  
     $scope.increase = function () {
       $scope.index += 1;
       $scope.num = number[$scope.index];
     }
  })
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/3JEmdYgcC18itXkZp3th?p=preview" rel="nofollow noreferrer">Live Demo</a></p>