【Angular】在Angular中进行本地环境和工作空间设置
因为想试试Angular,所以匆忙根据官方文档创建了一个项目。
请注意,假设已经安装了Node.js。
透過安裝 Angular CLI 來導入。
使用npm包管理器安装命令行界面(CLI)
npm install -g @angular/cli
工作空间、项目启动
ng new angular-app-sample
? Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing Angular CLI commands
will show possible options and autocomplete arguments. (Enabling autocompletion will modify configuration files in your
home directory.)
>> CLIを初めて使用する時にプロンプトを表示し、自動補完を設定するように求めてきます
? Would you like to share pseudonymous usage data about this project with the Angular Team
at Google under Google's Privacy Policy at https://policies.google.com/privacy. For more
details and how to change this setting, see https://angular.io/analytics.
>> GoogleのAngularチームに情報共有するか聞かれる
? Would you like to add Angular routing?
>> ルーティングどうするか聞かれる
? Which stylesheet format would you like to use?
>> スタイルシートどうするか聞かれる

运行应用程序
“ng serve”命令会启动服务器,监视文件,并在文件发生更改时重新构建应用。使用”–open”(或”-o”)选项可自动在浏览器中打开 http://localhost:4200/。
cd angular-app-sample
ng serve --open

请最后确认版本。
ng version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 14.2.5
Node: 18.9.0 (Unsupported)
Package Manager: npm 8.19.1
OS: darwin x64
Angular: 14.2.5
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1402.5
@angular-devkit/build-angular 14.2.5
@angular-devkit/core 14.2.5
@angular-devkit/schematics 14.2.5
@schematics/angular 14.2.5
rxjs 7.5.7
typescript 4.7.4