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:
--collectionA collection of schematics to use in generating the initial application. Aliases: -c--commit default:trueInitial git repository commit information.--create-application default:trueCreate 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.--defaultsDisable interactive input prompts for options with a default.--directoryThe directory name to create the workspace in.--dry-run default:falseRun through and reports activity without writing out results. Aliases: -d--force default:falseForce overwriting of existing files. Aliases: -f--help default:falseShows a help message for this command in the console.--inline-styleInclude 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-templateInclude template inline in the component TS file. By default, an external template file is created and referenced in the component TypeScript file. Aliases: -t--interactiveEnable interactive input prompts.--legacy-browsers default:falseDeprecated: Legacy browsers support is deprecated since version 12.--minimal default:falseCreate a workspace without any testing frameworks. (Use for learning purposes only.)--new-project-root default:projectsThe path where new projects will be created, relative to the new workspace root.--package-managerThe package manager used to install dependencies.--prefix default:appThe prefix to apply to generated selectors for the initial project. Aliases: -p--routingGenerate a routing module for the initial project.--skip-git default:falseDo not initialize a git repository. Aliases: -g--skip-install default:falseDo not install dependency packages.--skip-tests default:falseDo not generate "spec.ts" test files for the new project. Aliases: -S--strict default:trueCreates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time.--styleThe file extension or preprocessor to use for style files.--verbose default:falseAdd more details to output logging. Aliases: -v--view-encapsulationThe view encapsulation strategy to use in the initial project.