X Tutup
Skip to content

Router remove directive interceptor#7319

Closed
petebacondarwin wants to merge 3 commits intoangular:masterfrom
petebacondarwin:router-remove-directive-interceptor
Closed

Router remove directive interceptor#7319
petebacondarwin wants to merge 3 commits intoangular:masterfrom
petebacondarwin:router-remove-directive-interceptor

Conversation

@petebacondarwin
Copy link
Copy Markdown
Contributor

No description provided.

@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 petebacondarwin added comp: router action: review The PR is still awaiting reviews from at least one requested reviewer effort2: days labels Feb 26, 2016
@petebacondarwin petebacondarwin force-pushed the router-remove-directive-interceptor branch 5 times, most recently from c2748e0 to 2ae1131 Compare March 3, 2016 13:15
@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

@googlebot googlebot added cla: yes and removed cla: no labels Mar 3, 2016
@petebacondarwin petebacondarwin force-pushed the router-remove-directive-interceptor branch from 2ae1131 to c467595 Compare March 5, 2016 11:56
@petebacondarwin petebacondarwin added the refactoring Issue that involves refactoring or code-cleanup label Mar 5, 2016
@btford
Copy link
Copy Markdown
Contributor

btford commented Mar 7, 2016

Looks good, but two tests are failing (missing a mocked out $rootScope it looks like).

@btford btford added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 7, 2016
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.
@petebacondarwin petebacondarwin force-pushed the router-remove-directive-interceptor branch from c467595 to a5cc00a Compare March 7, 2016 22:11
@btford btford added pr_state: LGTM action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Mar 8, 2016
@btford btford assigned vikerman and unassigned btford Mar 8, 2016
@mary-poppins
Copy link
Copy Markdown

User @martine does not have PR merging privileges.

@evmar
Copy link
Copy Markdown
Contributor

evmar commented Mar 9, 2016

g3sync says this is ok, but I currently lack the admin rights to merge it. Working on it.

@mary-poppins
Copy link
Copy Markdown

Merging PR #7319 on behalf of @martine to branch presubmit-martine-pr-7319.

@mhevery mhevery closed this in 7f22bd6 Mar 9, 2016
@petebacondarwin petebacondarwin deleted the router-remove-directive-interceptor branch September 2, 2017 14:44
@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: yes effort2: days refactoring Issue that involves refactoring or code-cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup