fix(router): handle URL that does not match a route#7379
fix(router): handle URL that does not match a route#7379petebacondarwin wants to merge 4 commits intoangular:masterfrom
Conversation
|
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. |
2d99f87 to
0ad1326
Compare
|
CLAs look good, thanks! |
0ad1326 to
d55652b
Compare
8f5a42f to
40fe70f
Compare
|
LGTM, let's merge this! |
|
@petebacondarwin - Can you rebase this? Thanks |
The directiveIntrospector was a bit of a hack to allow the router to read the `$routeConfig` annocation and `$routerCanActivate` hook from directives when they were registered. It turns out that if we put these properties on the component controller's constructor function (i.e. as static class methods) then we can simply use the `$injector` to access it as required. Currently, people put the properties directly on their component definition objects. In Angular 1.5.1, we will copy these properties onto the controller constructor to maintain a simple migration path. But going forward it may be better to encourage people to add the properties directly to the controller constructor.
These tests were registering new components after the application had been bootstrapped, which is not a valid use case for synchronous routes in Angular 1. In particular it was registering the "root" component, which caused the `$rootRouter` to blow up, when it was instantiated, pointing to a root component that did not yet exist.
Until Angular 1.5.1 is released, the `$routeConfig` and `$routerCanActivate` annotations for components must live on the controller constructor. In Angular 1.5.1, it will automatically copy these annotations across from the component definition file.
40fe70f to
520add7
Compare
|
@vikerman Rebased! |
|
#7319 is in, can you rebase? |
|
merged as 8e3e450 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Only the last commit is relevant here. Once #7319 lands I'll rebase
Closes #7349
Closes #7203