5 lines
15 KiB
JSON
5 lines
15 KiB
JSON
|
{
|
||
|
"id": "cli",
|
||
|
"title": "CLI Overview and Command Reference",
|
||
|
"contents": "\n\n\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/aio/content/cli/index.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</div>\n\n\n<div class=\"content\">\n<h1 id=\"cli-overview-and-command-reference\">CLI Overview and Command Reference<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"cli#cli-overview-and-command-reference\"><i class=\"material-icons\">link</i></a></h1>\n<p>The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications directly from a command shell.</p>\n<h2 id=\"installing-angular-cli\">Installing Angular CLI<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"cli#installing-angular-cli\"><i class=\"material-icons\">link</i></a></h2>\n<p>Major versions of Angular CLI follow the supported major version of Angular, but minor versions can be released separately.</p>\n<p>Install the CLI using the <code>npm</code> package manager:\n<code-example language=\"bash\">\nnpm install -g @angular/cli\n</code-example></p>\n<p>For details about changes between versions, and information about updating from previous releases,\nsee the Releases tab on GitHub: <a href=\"https://github.com/angular/angular-cli/releases\">https://github.com/angular/angular-cli/releases</a></p>\n<h2 id=\"basic-workflow\">Basic workflow<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"cli#basic-workflow\"><i class=\"material-icons\">link</i></a></h2>\n<p>Invoke the tool on the command line through the <code>ng</code> executable.\nOnline help is available on the command line.\nEnter the following to list commands or options for a given command (such as <a href=\"cli/generate\">generate</a>) with a short description.</p>\n<code-example language=\"bash\">\nng help\nng generate --help\n</code-example>\n<p>To create, build, and serve a new, basic Angular project on a development server, go to the parent directory of your new workspace use the following commands:</p>\n<code-example language=\"bash\">\nng new my-first-project\ncd my-first-project\nng serve\n</code-example>\n<p>In your browser, open <a href=\"http://localhost:4200/\">http://localhost:4200/</a> to see the new app run.\nWhen you use the <a href=\"cli/serve\">ng serve</a> command to build an app and serve it locally, the server automatically rebuilds the app and reloads the page when you change any of the source files.</p>\n<div class=\"alert is-helpful\">\n<p> When you run <code>ng new my-first-project</code> a new folder, named <code>my-first-project</code>, will be created in the current working directory. Since you want to be able to create files inside that folder, make sure you have sufficient rights in the current working directory before running the command.</p>\n<p> If the current working directory is not the right place for your project, you can change to a more appropriate directory by running <code>cd <path-to-other-directory></code> first.</p>\n</div>\n<h2 id=\"workspaces-and-project-files\">Workspaces and project files<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"cli#workspaces-and-project-files\"><i class=\"material-icons\">link</i></a></h2>\n<p>The <a href=\"cli/new\">ng new</a> command creates an <em>Angular workspace</em> folder and generates a new app skeleton.\nA workspace can contain multiple apps and libraries.\nThe initial app created by the <a href=\"cli/new\">ng new</a> command is at the top level of the workspace.\nWhen you generate an additional app or library in a workspace, it goes into a <code>projects/</code> subfolder.</p>\n<p>A newly generated app contains the source files for a root module, with a root component and template.\nEach app has a <code>src</code> folder that contains the logic, data, and assets.</p>\n<p>You can edit the generated files di
|
||
|
}
|