title: AngularJS routing injection
body: <p>I'm trying to delay loading of a controller until my AJAX request has returned for the particular item.  In each controller, I define the route and controller like:</p>
  
  <pre><code>define(['app'], function(app){
  
    app.config(["$routeProvider", function($routeProvider) {
        $routeProvider.when('/app-builder/:id', {
            templateUrl: 'views/app-builder.html',
            controller: 'AppBuilderCtrl',
            resolve: {
                resolvedVal: function($routeParams, AppsModel) {
                    return AppsModel.findOne($routeParams.id);
                }
            }
        });
    }]);
  
    app.controller('AppBuilderCtrl',  [function() { .... }]);
  
  });
  </code></pre>
  
  <p>Problem is <code>$routeParams</code> does not have the property <code>id</code> when <code>resolvedVal</code> is called.  What am I missing here?  If this isn't the right approach, what is?</p>