Router remove directive interceptor#7319
Router remove directive interceptor#7319petebacondarwin wants to merge 3 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. |
c2748e0 to
2ae1131
Compare
|
CLAs look good, thanks! |
2ae1131 to
c467595
Compare
|
Looks good, but two tests are failing (missing a mocked out |
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.
c467595 to
a5cc00a
Compare
|
User @martine does not have PR merging privileges. |
|
g3sync says this is ok, but I currently lack the admin rights to merge it. Working on it. |
|
Merging PR #7319 on behalf of @martine to branch presubmit-martine-pr-7319. |
|
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. |
No description provided.