0

I am trying to consume 2 custom Angular 9 libraries. One contains services and the other components. I seems that I imported the services and module containing the components correctly in my consuming app.module. The library with the services imports fine and the services are usable. When I try to use a component from the other library module in a template, the component isn't rendered and there are no errors. If I import the component into the routing module and and wire it up to a route, the component renders when navigating to the route.

Why isn't the module rendering when used in a template?

afriedman111
  • 1,925
  • 4
  • 25
  • 42

1 Answers1

0

If your library code or its templates depend on other libraries (such as Angular Material, for instance), you must configure your library with those dependencies.

reference: https://angular.io/guide/creating-libraries

mohamed saeed
  • 147
  • 1
  • 6
  • I was thinking that since the component works when used in a route definition, the dependencies are working. I figured the problem might be a configuration issue with, for example, tsconfig. However I am working with a complex library structure. And I'm using npm pack and installing the packages locally. – afriedman111 Jun 08 '21 at 15:12