How to use the Angular CLI new command line

Created

Creates and initializes a new Angular application that is the default project for a new workspace.

Provides interactive prompts for optional configuration, such as adding routing support. All prompts can safely be allowed to default.

Create
ng new workspace
ng n workspace
ng serve
? Do you want to enforce stricter type checking and stricter bundle budgets in the workspace?
  This setting helps improve maintainability and catch bugs ahead of time.
  For more information, see https://angular.io/strict Yes
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS   [ https://sass-lang.com/documentation/syntax#scs
s                ]
CREATE workspace/README.md (1019 bytes)

The Angular CLI new Help Commands and Options

Usage: 
  ng new <name> [options]
  ng n <name> [options]

Arguments:
<name>
The name of the new workspace and initial project.
Options:
--collection
A collection of schematics to use in generating the initial application. Aliases: -c
--commit default:true
Initial git repository commit information.
--create-application default:true
Create a new initial application project in the 'src' folder of the new workspace. When false, creates an empty workspace with no initial application. You can then use the generate application command so that all applications are created in the projects folder.
--defaults
Disable interactive input prompts for options with a default.
--directory
The directory name to create the workspace in.
--dry-run default:false
Run through and reports activity without writing out results. Aliases: -d
--force default:false
Force overwriting of existing files. Aliases: -f
--help default:false
Shows a help message for this command in the console.
--inline-style
Include styles inline in the component TS file. By default, an external styles file is created and referenced in the component TypeScript file. Aliases: -s
--inline-template
Include template inline in the component TS file. By default, an external template file is created and referenced in the component TypeScript file. Aliases: -t
--interactive
Enable interactive input prompts.
--legacy-browsers default:false
Deprecated: Legacy browsers support is deprecated since version 12.
--minimal default:false
Create a workspace without any testing frameworks. (Use for learning purposes only.)
--new-project-root default:projects
The path where new projects will be created, relative to the new workspace root.
--package-manager
The package manager used to install dependencies.
--prefix default:app
The prefix to apply to generated selectors for the initial project. Aliases: -p
--routing
Generate a routing module for the initial project.
--skip-git default:false
Do not initialize a git repository. Aliases: -g
--skip-install default:false
Do not install dependency packages.
--skip-tests default:false
Do not generate "spec.ts" test files for the new project. Aliases: -S
--strict default:true
Creates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time.
--style
The file extension or preprocessor to use for style files.
--verbose default:false
Add more details to output logging. Aliases: -v
--view-encapsulation
The view encapsulation strategy to use in the initial project.

Related Tags