Angular 2 declarations in specific component

岁酱吖の 提交于 2019-12-05 16:24:20

You can put the component declaration into a Feature Module.
The Feature Module should be imported into the App Module.

Now it's up to you if you consider that your component it's a feature and deserve a separate Module or not.
I'm aware that all this thing with the modules is not so simple and clear as it was with the directives, but there were some design things in Angular2 that couldn't be resolved in other way.

Documentation : https://angular.io/guide/feature-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!