jQuery UI Widgets Forums Angular Sharing Components – Best Practices – jqxModule

This topic contains 3 replies, has 2 voices, and was last updated by  Ivo Zhulev 7 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author

  • a2m developer
    Participant

    I’m developing a large application (Angular4) with many modules. Most of these modules will be using the JQWidgets Components and will be lazy loading. Everything is working fine, until I tried to declare the same Component in two different modules. Using a shared module, is not a problem, but I am surprised there is not already a JQWidgets Module. Am I missing something?

    Just wondering what the best practices are for this situation. Say I create a JQWidgets Module that declares all the components, and share that module with all the others. Is it bad practice to use a shared module that declare components that are not being used for that particular Module?

    Is this making sense? 🙂


    Ivo Zhulev
    Participant

    Hi a2m developer,

    Yes, it is a bad practice. That’s why we have every widget in separate component so you can include only the ones you need. Don’t worry if you need the same component in different modules. When you build the app for production it will leave only one of it.

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/


    a2m developer
    Participant

    Hi Ivo, Thanks for the reply.

    I understand where you’re coming from, but I’m still having a hard time completely understanding the best practices for this situation. I must declare components in 1 module in order to use them in other components. Are you saying to declare all the jQWidget components in the app (root) module instead of a shared module? In the terms of Best Practices, how are these approaches two different?


    Ivo Zhulev
    Participant

    Hi a2m developer,

    If I understand you right, if you declare just your needed jQWidgets components in even the root module, you will still get better performance than if you have a module declaring all the components.

    Regards,
    Ivo

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.