Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router-outlet does not send activate event on attach #20501

Closed
Mysame opened this issue Nov 17, 2017 · 4 comments
Closed

router-outlet does not send activate event on attach #20501

Mysame opened this issue Nov 17, 2017 · 4 comments
Labels
area: router needs reproduction This issue needs a reproduction in order for the team to investigate further
Milestone

Comments

@Mysame
Copy link

Mysame commented Nov 17, 2017

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

https://github.com/angular/angular/blob/5.0.1/packages/router/src/directives/router_outlet.ts#L66
In case an existing component gets mounted to a router-outlet, attach gets called.
Attach does not emit a change to the activateEvents EventEmitter, even though it does change the isActive property of the router.

Expected behavior

Attach also emits a change to the activateEvents EventEmitter

What is the motivation / use case for changing the behavior?

In my use case, I want my parent to attach events to the child components.
The children are loaded in a router-outlet, which resorts to me having to listen to router-outlet activate event in order to bind to the child components (for reasons, I can't use a service).

Environment


Angular version: 5.0.1

Browser:
- [x] All
@jasonaden jasonaden added the needs reproduction This issue needs a reproduction in order for the team to investigate further label Nov 21, 2017
@jasonaden
Copy link
Contributor

I'm sorry but reported issues require a reproduction of the issue. We suggest using StackBlitz, Plunker or Github.

If this issue persists, please create a reproduction using one of the links above. Describe the difference between the expected and current behavior in a new issue with the reproduction linked.

@ngbot ngbot bot added this to the needsTriage milestone Feb 26, 2018
@JihedHalimi
Copy link

We also have the same problem. To reproduce the issue, change the RouteReuseStrategy to reuse components. The activate event of the router-outlet is triggered when the component is created the first time but when we navigate away and then come back, the component is reused and the activate event is not triggered.

@jasonaden
Copy link
Contributor

Sorry, this should have been closed back when the Need repo label was applied. There is still no reproduction attached, so I'll close now. If there's an issue with reproduction, please create a new issue.

@angular-automatic-lock-bot
Copy link

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 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: router needs reproduction This issue needs a reproduction in order for the team to investigate further
Projects
None yet
Development

No branches or pull requests

4 participants