I'm just updating my angular2-app
to new RC5
. I got quite far, and everything seems ok, but now I want to re-organize it into NgModules
and came across one thing:
I used a component ("ComponentA") across multiple other components in different Modules (say ModuleA & ModuleB).
As soon as use it that way, I get an:
Uncaught Type ComponentA is part of the
declarations of 2 modules: ModuleA and ModuleB!
Error.
As far as I see, the only way to get around that is to use a Shared-Module
with all my common stuff, is that right? Or is there an easier way to share components across Modules?
Thanks in advance :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…