Many Modules using the same component causes error - Angular 2

前端 未结 2 876
傲寒
傲寒 2021-02-02 12:55

I have a shared component called GoComponent that I want to use in 2 modules: FindPageModule and AddPageModule.

When I add it in the declarations of \"FindPageModule\" a

2条回答
  •  梦如初夏
    2021-02-02 13:42

    If you want to use the GoComponent across multiple modules, you should be created a "shared" module and add the GoComponent to the shared module's exports. Then you import shared module into your other modules where you want to use this component.

    Find out more information at here

    Hope this help!

提交回复
热议问题