Skip to content

Commit

Permalink
fix(angular1_router): rename router component binding to $router
Browse files Browse the repository at this point in the history
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: '<'
  }
}
```
  • Loading branch information
petebacondarwin authored and vikerman committed Mar 3, 2016
1 parent 1d49b3e commit 1174473
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions modules/angular1_router/test/integration/router_spec.js
Expand Up @@ -139,12 +139,8 @@ describe('router', function () {
bindings: options.bindings,
controller: getController(options),
};
if (options.template) {
definition.template = options.template;
}
if (options.templateUrl) {
definition.templateUrl = options.templateUrl;
}
if (options.template) definition.template = options.template;
if (options.templateUrl) definition.templateUrl = options.templateUrl;

applyStaticProperties(definition, options);
$compileProvider.component(name, definition);
Expand Down

0 comments on commit 1174473

Please sign in to comment.