ng generate application to a specific folder (without projects folder)

1.8k Views Asked by At

I have a folder "dashboards". Inside that i'm trying to create applications using "ng g application promotions". But it creates inside projects/promotions. I also tried using "--flat". But it still creates folder. How to create without folder?

2

There are 2 best solutions below

1
Nithya Rajan On BEST ANSWER

In your angular.json, change the property value of newProjectRoot from projects to dashboards.

"newProjectRoot": "dashboards",

If you create any new application in the workspace, then the app will be generated inside the dashboards folder.

0
Den Kerny On

try:

ng new myApp --newProjectRoot=my_folder

where my_folder is needed folder name.

then check your angular.json file and you'll see:

"newProjectRoot": "my_folder"

ng new commands can be found here