title: How to use angularjs config block?
body: <p>I am new to angularJS and trying to learn it. I came across config function
  where I see two different arguments as in below example.</p>
  
  <p>Example 1</p>
  
  <pre><code>dashboardApp.config(function($stateProvider, $urlRouterProvider) {
  //$urlRouterProvider.when('', '/add');
  $stateProvider.state('add', 
                   { 
                       url:'/add?month&amp;year', 
                       templateUrl: 'partial/add.html', 
                       controller: 'AddListController' 
                   })
  });
  </code></pre>
  
  <p>Example 2</p>
  
  <pre><code>gm.config(['$routeProvider', 'Path', function($routeProvider, Path) {
  $routeProvider.when('/login', { 
      templateUrl: Path.view('application/authentication/login.html'), 
      controller: 'authController' 
  });
  }]);
  </code></pre>
  
  <p>In the first example, config has a function parameter. And in second example config has array parameter. </p>
  
  <p>Can someone please explain to me what is the difference between these two approaches and when to use which?</p>