0

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?

Thanks!

cjr
  • 520
  • 2
  • 7
  • 22

1 Answers1

1

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.

Community
  • 1
  • 1
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567