1.目录结构分析
e2e:用来做自动化测试的
node_modules:存放第三方依赖包
src:应用源代码
.editorconfig:编辑器配置文件
.gitignore:git配置文件
package-lock.json:锁定了npm install下载的依赖包的版本
package.json:npm配置文档
README.md:项目说明文档
tsconfig.json:typeScript编译器的配置
tslint.json:tslint的配置文件,用来检查代码质量
app:组件,app.module.ts
assets:静态资源
environments:环境配置文件
browserslist:做浏览器兼容
index.html:应用的根html
karma.config.js:karma单元测试配置文件
main.ts:项目入口点
polyfills.ts:导入一些依赖库,让项目能正常运行在老浏览器
styles.css:全局的css
test.ts:自动化测试文件
tsconfig.app.json:typeScript编译器的配置
tsconfig.spec.json:typeScript编译器的配置
tslint.json:tslint的配置文件,用来检查代码质量
2.app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }