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:
Peter Bacon Darwin 2016-02-10 17:00:34 -08:00 committed by Vikram Subramanian
parent 5586c29492
commit 2548ce86db
1 changed files with 2 additions and 6 deletions

View File

@ -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);