Skip to content

Commit 2548ce8

Browse files
petebacondarwinvikerman
authored andcommitted
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: '<' } } ```
1 parent 5586c29 commit 2548ce8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

modules/angular1_router/test/integration/router_spec.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,8 @@ describe('router', function () {
139139
bindings: options.bindings,
140140
controller: getController(options),
141141
};
142-
if (options.template) {
143-
definition.template = options.template;
144-
}
145-
if (options.templateUrl) {
146-
definition.templateUrl = options.templateUrl;
147-
}
142+
if (options.template) definition.template = options.template;
143+
if (options.templateUrl) definition.templateUrl = options.templateUrl;
148144

149145
applyStaticProperties(definition, options);
150146
$compileProvider.component(name, definition);

0 commit comments

Comments
 (0)