5 lines
16 KiB
JSON
Raw Permalink Normal View History

{
"id": "cli/new",
"title": "ng new",
"contents": "\n<article>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular-cli/edit/master/packages/angular/cli/commands/new.json?message=docs(...)%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular-cli/tree/v12.0.0-next.7/packages/angular/cli/commands/new.json\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n \n\n\n<div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io/cli\", \"name\": \"CLI\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/cli/new\", \"name\": \"new\" } }\n ]\n }\n </script>\n <a href=\"cli\">CLI</a>\n</div>\n\n \n<header class=\"cli-header\">\n <h1 id=\"ng-new\">ng new<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"cli/new#ng-new\"><i class=\"material-icons\">link</i></a></h1>\n</header>\n\n\n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"cli-body\">\n \n <p>Creates a new workspace and an initial Angular application.</p>\n\n \n<code-example hidecopy=\"true\" class=\"no-box api-heading no-auto-link\">ng <span class=\"cli-name\">new</span> &#x3C;<var>name</var>> [<var>options</var>]</code-example>\n\n<code-example hidecopy=\"true\" class=\"no-box api-heading no-auto-link\">ng <span class=\"cli-name\">n</span> &#x3C;<var>name</var>> [<var>options</var>]</code-example>\n\n\n\n \n <h2 class=\"no-anchor\" id=\"mode_edit---code----------description\">\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular-cli/edit/master/packages/angular/cli/commands/new.md?message=docs%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular-cli/tree/v12.0.0-next.7/packages/angular/cli/commands/new.md\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n Description\n </h2>\n <p>Creates and initializes a new Angular application that is the default project for a new workspace.</p>\n<p>Provides interactive prompts for optional configuration, such as adding routing support.\nAll prompts can safely be allowed to default.</p>\n<ul>\n<li>\n<p>The new workspace folder is given the specified project name, and contains configuration files at the top level.</p>\n</li>\n<li>\n<p>By default, the files for a new initial application (with the same name as the workspace) are placed in the <code>src/</code> subfolder. Corresponding end-to-end tests are placed in the <code>e2e/</code> subfolder.</p>\n</li>\n<li>\n<p>The new application's configuration appears in the <code>projects</code> section of the <code>angular.json</code> workspace configuration file, under its project name.</p>\n</li>\n<li>\n<p>Subsequent applications that you generate in the workspace reside in the <code>projects/</code> subfolder.</p>\n</li>\n</ul>\n<p>If you plan to have multiple applications in the workspace, you can create an empty workspace by setting the <code>--createApplication</code> option to false.\nYou can then use <code>ng generate application</code> to create an initial application.\nThis allows a workspace name different from the initial app name, and ensures that all applications reside in the <code>/projects</code> subfolder, matching the structure of the configuration file.</p>\n\n \n\n \n\n<h2 class=\"no-anchor\" id=\"arguments\">Arguments</h2>\n<table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th
}