fix(angular1_router): rename router
component binding to $router
The current router is passed to the current component via a binding. To indicate that this is an angular provided object, this commit renames the binding to `$router`. BREAKING CHANGE: The recently added binding of the current router to the current component has been renamed from `router` to `$router`. So now the recommended set up for your bindings in your routed component is: ```js { ... bindings: { $router: '<' } } ```
This commit is contained in:

committed by
Pete Bacon Darwin

parent
d4a4d81173
commit
edad8e3f56
@ -155,7 +155,7 @@ function ngOutletDirective($animate, $q: ng.IQService, $router) {
|
||||
}
|
||||
|
||||
this.controller.$$template =
|
||||
'<' + dashCase(componentName) + ' router="$$router"></' + dashCase(componentName) + '>';
|
||||
'<' + dashCase(componentName) + ' $router="$$router"></' + dashCase(componentName) + '>';
|
||||
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
|
||||
|
Reference in New Issue
Block a user