0

I have a doubt why @input and @output properties does not work when using router outlet in angular?

Abhishek Singh
  • 900
  • 7
  • 19

2 Answers2

1

router outlet is used for the routing. And there is another way to send data with your route:

With id and services:

{ path: 'hero/:id', component: YourComponent}

check this answer

Wandrille
  • 6,267
  • 3
  • 20
  • 43
1

The only purpose of @Input and @Output are to define a public interface on nested (child) components. These are then used to communicate between the child component and the parent component that hosts it.

They are not meant for communication between routed components. Other mechanisms are provided for that purpose.

DeborahK
  • 57,520
  • 12
  • 104
  • 129