创建指令语法:
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模块。