Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Portable modules that receive services from the root?
posted

I'm trying to reuse several pages/modules between two apps. I understand you can create libraries and publish those modules to NPM. My problem is dependency injection.

Imagine you have two cookbook apps that load recipes via a RecipeService. One is totally static for a published cookbook, so its RecipeService uses JSON files. The other uses a REST API. It's easy to write two different apps with two different RecipeServices.

But how can I create a RecipePageModule that consumes an interface for RecipeService? If I try to define something like RecipeServiceInterface and "inject" that, I just get "Can't resolve all parameters for RecipePage," which makes sense. Is there a way to say, in a module, "expect the parent AppModule to provide me with a RecipeService"?

  • 1560
    Offline posted
    Hello,
    I have been looking into your post and according to my understanding; your question is not directly referring to any specific Infragistics control. Since this forum is oriented to helping customers achieve their goals via using Infragistics Toolsets my suggestion would be to have a look at a forum aimed to solve general Angular issues. For example, I believe you might consider this thread helpful.
    In case that you decide to include Infragistics controls in your approach and you are facing any issues – we would be glad to assist you.

    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer