new
ng newng nCreates 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.
The new workspace folder is given the specified project name, and contains configuration files at the top level.
By default, the files for a new initial application (with the same name as the workspace) are placed in the
src/subfolder.The new application's configuration appears in the
projectssection of theangular.jsonworkspace configuration file, under its project name.Subsequent applications that you generate in the workspace reside in the
projects/subfolder.
If you plan to have multiple applications in the workspace, you can create an empty workspace by using the --no-create-application option.
You can then use ng generate application to create an initial application.
This allows a workspace name different from the initial app name, and ensures that all applications reside in the /projects subfolder, matching the structure of the configuration file.
Arguments
nameThe name of the new workspace and initial project.
stringOptions
collectionc A collection of schematics to use in generating the initial application.
stringcommitInitial git repository commit information.
booleanDefaulttruecreate-applicationCreate 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.
booleanDefaulttruedefaultsDisable interactive input prompts for options with a default.
booleanDefaultfalsedirectoryThe directory name to create the workspace in.
stringdry-rund Run through and reports activity without writing out results.
booleanDefaultfalseforceForce overwriting of existing files.
booleanDefaultfalsehelpShows a help message for this command in the console.
booleaninline-styles Include styles inline in the component TS file. By default, an external styles file is created and referenced in the component TypeScript file.
booleaninline-templatet Include template inline in the component TS file. By default, an external template file is created and referenced in the component TypeScript file.
booleaninteractiveEnable interactive input prompts.
booleanDefaulttrueminimalCreate a workspace without any testing frameworks. (Use for learning purposes only.)
booleanDefaultfalsenew-project-rootThe path where new projects will be created, relative to the new workspace root.
stringDefaultprojectspackage-managerThe package manager used to install dependencies.
stringprefixp The prefix to apply to generated selectors for the initial project.
stringDefaultapproutingEnable routing in the initial project.
booleanskip-gitg Do not initialize a git repository.
booleanDefaultfalseskip-installDo not install dependency packages.
booleanDefaultfalseskip-testsS Do not generate "spec.ts" test files for the new project.
booleanDefaultfalsessrCreates an application with Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) enabled.
booleanstandaloneCreates an application based upon the standalone API, without NgModules.
booleanDefaulttruestrictCreates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.dev/tools/cli/template-typecheck#strict-mode
booleanDefaulttruestyleThe file extension or preprocessor to use for style files.
stringview-encapsulationThe view encapsulation strategy to use in the initial project.
string