Angular2 Routes, Components and Inputs: Can they work together?

I have a component that has a set of inputs in takes in. This component is generic and basically takes in a bunch inputs to config it a certain way. I’ve recently had a requirement that this component needs to be used as part of a RouteConfig. The issue I am running into is that I don’t see how you can supply these inputs through the RouteConfig like you could through bindings or component references.

The only solution I can forsee if to create a level between this component and the route which creates these inputs and then loads the component but is there a way around not having to do this?


Leave a Reply

1 Comment threads
0 Thread replies
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
newest oldest most voted
Notify of

For how to get RouteParams see How to get GET paramater in Angular2?

If your component should work as a routed component and as a statically added component that uses @Input()s and @Output()s for binding, using a wrapper is IMHO the best approach.