Search code examples
angularapexcharts

Access template selector with cdn import in angular


Is there a way to use a cdn import that requires a components selector to used in template. eg.: <apx-chart></apx-chart> needs to be used in multiple templates.

To reduce my bundle size i've tried to get the cdn import, but now since i've cleared all the modules that import the corresponding module that handles the component, selection now I get template errors since angular doesn't know what said selector is.

Is there a way to handle this? or cdn imports should only be used when you want to use them in .ts files?

Thanks in advance.


Solution

  • To anyone seeking redemption.

    To solve the issue, is to place said 3rd party lib in a lazy loaded module (definately not in a shared module that's imported by all modules).

    It helped us to reduce bundle sizes.

    Hope it helps to anyone facing such issue.