How to pass property-bind to the router-outlet in angular 2

0

Hello everyone. I am learning angular beginner 2 and I have this title doubt. My router-outlet: <router-outlet [busca]="termo"></router-outlet> with this property-bind and returns me this error in the console:

  

Unhandled Promise rejection: Template parse errors:   Can not bind to 'search' since it is not a known property of 'router-outlet'.

Thank you in advance.

    
asked by anonymous 09.08.2017 / 02:53

2 answers

2

If I am not mistaken, it is not possible to pass a bind to router-outlet, it acts as only a selector that Angular dynamically fills with the desired component based on the current state of the route. To understand better, what would you like with this bind ? Play information dynamically to components? If yes, it is more interesting to work with parameters via route or even Input in your components

    
12.08.2017 / 15:42
2

I think there's no way to do this ... if you want to pass information from one component to another maybe it's better to create a shared service

    
13.08.2017 / 17:04