diff --git a/modules/angular1_router/src/ng_outlet.ts b/modules/angular1_router/src/ng_outlet.ts index ab7ea56580..7572d92ff2 100644 --- a/modules/angular1_router/src/ng_outlet.ts +++ b/modules/angular1_router/src/ng_outlet.ts @@ -155,7 +155,7 @@ function ngOutletDirective($animate, $q: ng.IQService, $router) { } this.controller.$$template = - '<' + dashCase(componentName) + ' router="$$router">'; + '<' + dashCase(componentName) + ' $router="$$router">'; this.controller.$$router = this.router.childRouter(instruction.componentType); this.controller.$$outlet = this; @@ -294,7 +294,7 @@ angular.module('ngComponentRouter', []) .directive('ngOutlet', ['$animate', '$q', '$router', ngOutletDirective]) .directive('ngOutlet', ['$compile', ngOutletFillContentDirective]) .directive('ngLink', ['$router', '$parse', ngLinkDirective]) - .directive('router', ['$q', routerTriggerDirective]); + .directive('$router', ['$q', routerTriggerDirective]); /* * A module for inspecting controller constructors diff --git a/modules/angular1_router/test/integration/router_spec.js b/modules/angular1_router/test/integration/router_spec.js index 935ab8b2ce..7c8eb1150e 100644 --- a/modules/angular1_router/test/integration/router_spec.js +++ b/modules/angular1_router/test/integration/router_spec.js @@ -47,10 +47,10 @@ describe('router', function () { it('should bind the component to the current router', inject(function($location) { var router; registerComponent('homeCmp', { - bindings: { router: '=' }, + bindings: { $router: '=' }, controller: function($scope, $element) { this.$routerOnActivate = function() { - router = this.router; + router = this.$router; }; }, template: 'Home' @@ -69,7 +69,7 @@ describe('router', function () { $rootScope.$digest(); var homeElement = elt.find('home-cmp'); expect(homeElement.text()).toBe('Home'); - expect(homeElement.isolateScope().$ctrl.router).toBeDefined(); + expect(homeElement.isolateScope().$ctrl.$router).toBeDefined(); expect(router).toBeDefined(); }));