Angular2-SignaturePad 项目教程
1. 项目的目录结构及介绍
angular2-signaturepad/
├── projects/
│ └── angular-signature-pad/
│ ├── editorconfig
│ ├── eslintrc.json
│ ├── gitignore
│ ├── npmignore
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── angular.json
│ ├── package-lock.json
│ ├── package.json
│ └── tsconfig.json
├── .editorconfig
├── .eslintrc.json
├── .gitignore
├── .npmignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── angular.json
├── package-lock.json
├── package.json
└── tsconfig.json
目录结构介绍
projects/angular-signature-pad/
: 包含 Angular 组件的主要代码和配置文件。.editorconfig
,.eslintrc.json
,.gitignore
,.npmignore
: 编辑器配置、代码风格检查、版本控制忽略和 npm 忽略文件。CHANGELOG.md
,LICENSE
,README.md
: 项目变更日志、许可证和自述文件。angular.json
: Angular 项目的配置文件。package-lock.json
,package.json
: npm 依赖管理文件。tsconfig.json
: TypeScript 编译配置文件。
2. 项目的启动文件介绍
项目的启动文件主要是 angular.json
和 package.json
中的脚本命令。
angular.json
{
"projects": {
"angular-signature-pad": {
"projectType": "library",
"root": "projects/angular-signature-pad",
"sourceRoot": "projects/angular-signature-pad",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/angular-signature-pad/tsconfig.lib.json",
"project": "projects/angular-signature-pad/ng-package.json"
}
}
}
}
}
}
package.json
{
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
}
}
3. 项目的配置文件介绍
tsconfig.json
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": true,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
}
}
package.json
{
"name": "angular2-signaturepad",
"version": "2.11.0",
"description": "Angular 2 component for szimek/signature_pad",
"author": "Wulfsolter",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/wulfsolter/angular2-signaturepad.git"
},
"keywords": [
"angular",
"angular2",
"signature",
"sign",
"finger",
"canvas"
],
"peerDependencies": {
"@angular/common": "^12.0.0",
"@angular/core": "^12.0.0"
},
"dependencies": {
"tslib": "^2.0.0"
}
}
以上是 Angular2