...">

Use @Output with <output-router> from angular 4.0 "

Use the selector for success.

<app-child1 (onVoted)="onVoted($event)"></app-child1>

      

But using a router will fail

<router-outlet  (onVoted)="onVoted($event)"></router-outlet>

      

I want to get a value from a component displayed on "router-to-egress".

Please tell me which 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-->

      

+3


source share





All Articles