title: Angular: Passing params from $routeProvider to controller
body: <p>I have multiple routes that invoke the same Controller and I would like to pass different variables to it.</p>
  
  <pre><code>// Example
  $routeProvider.
    when('/a', {
      templateUrl: 'test.html',
      controller: 'MyController' // should get passed 'exampleA'
    }).
    when('/b', {
      templateUrl: 'test.html',
      controller: 'MyController' // should get passed 'exampleB'
  });
  </code></pre>
  
  <p>I know that I could use the "resolve" object:</p>
  
  <pre><code>$routeProvider.
    when('/a', {
      templateUrl: 'test.html',
      controller: 'MyController',
      resolve: {test: function() { return true; }}
  });
  </code></pre>
  
  <p>To pass a value as a dependency:</p>
  
  <pre><code>app.controller('MyController', ['$scope', 'test', function ($scope, test) {
    console.log(test); // true
  }
  </code></pre>
  
  <p>My problem with that approach is that my app crashes if the resolve object is missing on other routes and I would like to pass optional params.</p>
  
  <p>Is there any way to pass specific params to the Controller (from the route provider)?</p>
  
  <hr>
  
  <p>Thank you</p>