1-1 src文件夹
src --app --app.component.css(css) --app.component.html(html) --app.component.ts(js) --app.module.ts // 项目的根模块(App.vue),告诉angular如何组装应用。
1-2 app.moudle.ts
//app.module.ts 根模块
/* Angular的核心模块 */import { NgModule } from '@angular/core';/* 浏览器解析模块 */import { BrowserModule } from '@angular/platform-browser';/* App组件 */import { AppComponent } from './app.component';+ import {HttpClientModule} from '@angular/common/http'@NgModule({ /* 配置(声明)当前项目运行依赖的组件 */ declarations: [ AppComponent ], /* 配置当前项目运行依赖的其他模块 */ imports: [ BrowserModule, + HttpClientModule ], /* 配置项目所需要的服务 */ providers: [], /* 指定应用的主视图 */ bootstrap: [AppComponent]})/* 通过导出AppModule这个模块,来启动应用 */export class AppModule { }
//安装插件Angular