Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use --create-application=false with ng new command

Tags:

angular-cli

My motive is to create a UI library of my own using Angular 9. I was going through the Angular official documentation about Creating Libraries. They started with this command:

ng new my-workspace --create-application=false

And they say that --create-application=false will instruct the CLI to create the config file only and not the application code. Out of curiosity I created 2 projects one with this parameter and other one I generated normally with ng new my-project just to see what is the difference between project structure. I'm confused to see both are same.

Left one is without parameter while Right one is with parameter: enter image description here

Please correct my mistake.

My versions are:

Angular CLI: 6.2.9

Node: 10.19.0

OS: linux x64

Here is a recording of my steps: https://youtu.be/wsedP3DAsl4

like image 524
Tanzeel Avatar asked Nov 07 '25 17:11

Tanzeel


2 Answers

I'm using Angular CLI: 15.2.4, so, in order to work the command I used ng new myApp --create-application=false and works.

C:

like image 146
Francisco Hernandez Sabatino Avatar answered Nov 12 '25 16:11

Francisco Hernandez Sabatino


The --create-application flag is used with the ng new command. Setting this to false tells ng new not to create the initial Angular application in the Workspace. By default this flag is set to true to match the behavior of the previous versions of Angular CLI.

More info at this Medium blog post: Angular In Depth

So the difference is that you can create multiple 'projects' that share the same workspace instead of having one workspace for each project that would mean having one node_modules folder and so on..

like image 38
jcobo1 Avatar answered Nov 12 '25 17:11

jcobo1



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!