angular6中angular-cli自定义指令报错
创建指令语法:Directiveng g directive my-new-directive 问题:PS G:\webprojects\demo> ng g directive routes/dashboard/form-promptMore than one module matches. Use skip-import option to skip i...
·
创建指令语法:
| Directive | ng g directive my-new-directive |
问题:
PS G:\webprojects\demo> ng g directive routes/dashboard/form-prompt
More than one module matches. Use skip-import option to skip importing the component into the closest module.
![]()
解决办法:
ng g directive routes/dashboard/form-prompt --module=routes

是因为项目中有多个模块(包含AppModule, RoutesModule等),需要选中要配置的app模块。
更多推荐
所有评论(0)