title: Routing in angularjs for multiple controllers?
body: <p>I'm trying to build a view - I've set up two controllers to practice, one's HeaderCtrl, with some data in it (site title, header background, etc), the other should have the main content of the page - MainCtrl.</p>
  
  <p>When defining the route, I'm doing like so:</p>
  
  <pre><code>mainApp.config(function ($routeProvider) {
  $routeProvider
     .when('/',
     {
         controller: 'MainCtrl',
         templateUrl: 'modules/dashboard.html'
     })
  })
  </code></pre>
  
  <p>This works perfectly fine, but what I would want is to specify multiple parameters to this, something like this:</p>
  
  <pre><code>mainApp.config(function ($routeProvider) {
  $routeProvider
     .when('/',
     {
         controller: 'HeaderCtrl',
         templateUrl: 'modules/header.html'
     },
     {
         controller: 'MainCtrl',
         templateUrl: 'modules/dashboard.html'
     })
  })
  </code></pre>
  
  <p>This doesn't work so I'm guessing it's not the way to do it. What I'm actually asking - can you specify multiple controllers in $routeProvider ? Or what would be the correct way to build this view ? </p>