X Tutup
Skip to content

feat(router): add regex matchers#7332

Closed
petebacondarwin wants to merge 4 commits intoangular:masterfrom
petebacondarwin:btford-custom-url-matchers
Closed

feat(router): add regex matchers#7332
petebacondarwin wants to merge 4 commits intoangular:masterfrom
petebacondarwin:btford-custom-url-matchers

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

Fixes up #7325

petebacondarwin and others added 4 commits February 26, 2016 22:29
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: '<'
  }
}
```
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: '<'
  }
}
```
@petebacondarwin deserves credit for most of this commit.

This allows you to specify a regex and serializer function instead
of the path DSL in your route declaration.

```
@RouteConfig([
  { regex: '[a-z]+.[0-9]+',
    serializer: (params) => `{params.a}.params.b}`,
    component: MyComponent }
])
class Component {}
```

Closes angular#7325
Closes angular#7126
@petebacondarwin petebacondarwin added feature Label used to distinguish feature request from other issues action: merge The PR is ready for merge by the caretaker cla: yes comp: router labels Feb 27, 2016
@googlebot
Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@petebacondarwin
Copy link
Copy Markdown
Contributor Author

Dear @googlebot - @btford is the extra committer and if fully onboard with these commits being merged into Angular 2 :-) Best wishes, your friend, as always @petebacondarwin

@vikerman
Copy link
Copy Markdown
Contributor

vikerman commented Mar 1, 2016

LGTM from TAP presubmit.

@IgorMinar IgorMinar mentioned this pull request Mar 2, 2016
@naomiblack naomiblack closed this Mar 2, 2016
@petebacondarwin petebacondarwin deleted the btford-custom-url-matchers branch September 2, 2017 14:49
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: no feature Label used to distinguish feature request from other issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup