I want to provide a set of generic components, so they will be not aware of services that provides dependencies. Dependencies such components are promises. In other words I want to keep for instance data access out of the scope of those generic components. Any dependencies, especially data to render and component configuration should be provided to components by the context that are declaring the component. This is easy when I declare component in view as a DOM tag e.g.:
<generic-component data="getSomeData()" configuration="componentConfig"></generic-component>
But how I can handle that when component is invoked directly be the route?
I've read very similar issue but answer for the question definitely did not satisfy me. Accepted answer advice to put dependencies into component, but that means losing generic manner of component.
In Angular 1 approach to do so was by using resolve
property of route declaration. What is equivalent of Angular's 1 resolve in Angular 2?
Please refer to the mentioned question's example cause it's very accurate.