我已经构建了一个自定义原理图。我可以使用以下命令通过自定义逻辑示意图生成Angular组件:schematics ./fast/src/collection.json:fast project_name --debug=false
在逻辑示意图的父文件夹中。
但据推测,此命令也应该起作用:
ng new project_name --configuration=fast
尽管运行该命令,但出现以下错误:
An unhandled exception occurred: Schematic "ng-new" not found in collection "fast".
有人可以帮我吗?
谢谢!
这可能与我的index.ts中的这段代码有关:
function generateRepo(name: string): Rule {
return externalSchematic('@schematics/angular', 'ng-new', {
name,
version: '*',
directory: name,
routing: false,
style: 'scss',
inlineStyle: false,
inlineTemplate: false
});
}
Github Repo和我的代码: https://github.com/nearmint/angular-fast-serve