您所指的教程是使用 Angular 2,而 Angular 的最新版本是 6
从 Angular 6 开始的 CLI 项目将使用 angular.json 而不是 .angular-cli.json 进行构建和项目配置。
每个 CLI 工作区都有项目,每个项目都有目标,每个目标可以有配置。Docs
如果您希望生成的工件存储在自定义位置修改输出路径从"outputPath": "dist/ng6", 到"outputPath": "dist/yourcustomlocation", 下build 目标
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ng6": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ng6",**<----/modify this**
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets":
更多教程使用HttpModule 已被弃用,您应该改用HttpClientModule