Angular Forms 课程项目教程
angular-forms-courseAngular Forms In Depth (Video Course)项目地址:https://gitcode.com/gh_mirrors/an/angular-forms-course
1. 项目的目录结构及介绍
angular-forms-course/
├── e2e/
│ ├── src/
│ │ ├── app.e2e-spec.ts
│ │ ├── app.po.ts
│ ├── protractor.conf.js
│ ├── tsconfig.json
├── src/
│ ├── app/
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ ├── assets/
│ ├── environments/
│ │ ├── environment.prod.ts
│ │ ├── environment.ts
│ ├── index.html
│ ├── main.ts
│ ├── styles.css
│ ├── test.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ ├── tslint.json
├── .editorconfig
├── .gitignore
├── angular.json
├── karma.conf.js
├── LICENSE
├── package-lock.json
├── package.json
├── README.md
├── tsconfig.json
├── tslint.json
目录结构介绍
- e2e/: 端到端测试目录,包含测试脚本和配置文件。
- src/: 源代码目录,包含应用程序的主要代码。
- app/: 应用程序模块和组件。
- assets/: 静态资源文件。
- environments/: 环境配置文件。
- index.html: 主 HTML 文件。
- main.ts: 应用程序入口文件。
- styles.css: 全局样式文件。
- test.ts: 测试配置文件。
- .editorconfig: 编辑器配置文件。
- .gitignore: Git 忽略文件配置。
- angular.json: Angular 项目配置文件。
- karma.conf.js: Karma 测试运行器配置文件。
- LICENSE: 项目许可证。
- package-lock.json: npm 依赖锁定文件。
- package.json: npm 包管理文件。
- README.md: 项目说明文档。
- tsconfig.json: TypeScript 配置文件。
- tslint.json: TSLint 代码风格检查配置文件。
2. 项目的启动文件介绍
main.ts
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
- main.ts 是 Angular 应用程序的入口文件。
- 它负责启动 Angular 应用,并根据环境配置启用生产模式。
3. 项目的配置文件介绍
angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular-forms-course": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/angular-forms-course",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production":
angular-forms-courseAngular Forms In Depth (Video Course)项目地址:https://gitcode.com/gh_mirrors/an/angular-forms-course