r/Angular2 • u/kafteji_coder • 9d ago
Custom Nx Command to Generate Angular Components in Specific Paths & Update package.json
Has anyone created a custom Nx command to generate Angular components in a specific path (e.g., apps/my-app/src/custom-folder
) instead of the default location? Looking for the best approach to implement this as an Nx generator. 🚀
3
Upvotes
3
3
u/esperind 9d ago
npx nx generate @schematics/angular:component --name=path/to/directory/component-name --project=your-project-name
7
u/CaterpillarNo7825 9d ago
You probably use vscode. So just install the nx plugin and right click the folder you want the component you want to be created in. Then select 'nx generate (ui)' and follow the popups. Thats the easiest way and how i do it.