Use a selector to succeed.
<app-child1 (onVoted)="onVoted($event)"></app-child1>
But using a router will fail
<router-outlet (onVoted)="onVoted($event)"></router-outlet>
I want to receive a value from a component displayed on the "router-outlet".
Please tell me what method I have.
app:https://toparent.herokuapp.com/ src:https://github.com/kuniatsu/routerQuestion
<h1>
{{title}}
</h1>
<a href="c1">child1</a>
<router-outlet (onVoted)="onVoted($event)"></router-outlet><!--fail-->
<hr />
<app-child1 (onVoted)="onVoted($event)"></app-child1><!--success-->