问题描述
我想向我的 nx 工作区添加角度材质.
角度材料文档(
添加角度材质到默认项目:nx generate @angular/material:ng-add
附注.可能它会在未找到/安装的 nx 上引发错误.yarn add -g @nrwl/cli
.我认为可以将角材料添加到另一个项目中,还没有尝试
https://github.com/nrwl/nx/issues/3779#issuecomment-751136586
I'm wanting to add angular-material to my nx-workspace.
The angular material docs (https://material.angular.io/guide/getting-started) say I should run ng add @angular/material
.
I've tried that in the root of my nx workspace, as well as in an application folder I want to add it to, as well as in a lib project folder I want to add it to. In all cases I get the messageThe add command requires to be run in an Angular project, but a project definition could not be found.
The Angular Material docs used to include instructions on how to add dependencies manually, but I can't find that anymore. Does anyone know how to add it to projects in an Nx workspace these days?
If you created the an empty workspace you don't have angular.json, you will have a workspace.json, which is almost identical I think.
Assuming that you have already generated an agular app:
Install the angular material lib:
yarn add @angular/material
To see the avaible commands from the nx console:
nx list @angular/material
To add angular material to the default project:
nx generate @angular/material:ng-add
PS. Probably it will thrown an error on nx not found/installed. yarn add -g @nrwl/cli
. I think is possible to add angular material to another project, didn't try that yet
https://github.com/nrwl/nx/issues/3779#issuecomment-751136586
这篇关于将角材质添加到 Nx 工作区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!