Angular 2 Error ( 'directives' does not exist in type 'Component' )

故事扮演 提交于 2019-12-01 15:53:47

directives was removed from component. See the following: https://stackoverflow.com/a/39410642/5487673

The solution to the problem is simply to remove the directives attribute from your component. So long as the components listed under your directives attribute are declared at the NgModule level then you should be right.

I encountered that case and solved. As directives, you don't need to import and plug them to specific component. You could use them like this.

First, import them on the app.module.ts. Second, add imported directive into declarations. Then they would be working.

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