diff options
| author | Vojta Jina | 2012-01-20 14:04:53 -0800 | 
|---|---|---|
| committer | Vojta Jina | 2012-01-23 13:11:12 -0800 | 
| commit | dbffbefb7cd7af2ac063c95378a035aa9fbbd2ff (patch) | |
| tree | 047f7ae83c0573e1f1c22c44cba7644a1ab464b1 /src/service/route.js | |
| parent | 0196411dbe179afe24f4faa6d6503ff3f69472da (diff) | |
| download | angular.js-dbffbefb7cd7af2ac063c95378a035aa9fbbd2ff.tar.bz2 | |
refactor($controller): Add $controller service for instantiating controllers
So that we can allow user to override this service and use BC hack:
https://gist.github.com/1649788
Diffstat (limited to 'src/service/route.js')
| -rw-r--r-- | src/service/route.js | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/src/service/route.js b/src/service/route.js index 04bcfdb6..f8200fd4 100644 --- a/src/service/route.js +++ b/src/service/route.js @@ -63,8 +63,8 @@      </doc:example>   */  function $RouteProvider(){ -  this.$get = ['$rootScope', '$location', '$routeParams', '$injector', -      function( $rootScope,  $location,  $routeParams, $injector) { +  this.$get = ['$rootScope', '$location', '$routeParams', '$controller', +      function( $rootScope,  $location,  $routeParams, $controller) {      /**       * @ngdoc event       * @name angular.module.ng.$route#$beforeRouteChange @@ -280,7 +280,7 @@ function $RouteProvider(){              copy(next.params, $routeParams);              next.scope = parentScope.$new();              if (next.controller) { -              $injector.instantiate(next.controller, {$scope: next.scope}); +              $controller(next.controller, next.scope);              }            }          }  | 
