Ionic Rating 项目教程
ionic-rating An angularjs directive that take care of visualising a star rating bar项目地址:https://gitcode.com/gh_mirrors/io/ionic-rating
1. 项目的目录结构及介绍
ionic-rating/
├── src/
│ ├── app/
│ │ ├── components/
│ │ │ ├── ionic-rating/
│ │ │ │ ├── ionic-rating.component.html
│ │ │ │ ├── ionic-rating.component.scss
│ │ │ │ ├── ionic-rating.component.spec.ts
│ │ │ │ └── ionic-rating.component.ts
│ │ ├── app.component.html
│ │ ├── app.component.scss
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ │ ├── app.routing.ts
│ │ └── main.ts
│ ├── assets/
│ ├── environments/
│ ├── theme/
│ ├── index.html
│ ├── manifest.json
│ ├── service-worker.js
│ └── theme.scss
├── angular.json
├── package.json
├── tsconfig.json
└── tslint.json
目录结构介绍
- src/: 项目源代码目录。
- app/: 应用程序的主要代码目录。
- components/: 包含自定义组件的目录。
- ionic-rating/: 评分组件的目录,包含组件的 HTML、SCSS、测试和 TypeScript 文件。
- app.component.*: 应用程序的主组件文件。
- app.module.ts: 应用程序的根模块文件。
- app.routing.ts: 应用程序的路由配置文件。
- main.ts: 应用程序的入口文件。
- assets/: 静态资源目录。
- environments/: 环境配置目录。
- theme/: 主题样式目录。
- index.html: 应用程序的入口 HTML 文件。
- manifest.json: PWA 配置文件。
- service-worker.js: 服务工作者文件。
- theme.scss: 全局样式文件。
- angular.json: Angular 项目的配置文件。
- package.json: 项目的依赖和脚本配置文件。
- tsconfig.json: TypeScript 编译配置文件。
- tslint.json: TypeScript 代码风格配置文件。
2. 项目的启动文件介绍
main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
- main.ts: 这是应用程序的入口文件,负责引导 Angular 应用程序。它使用
platformBrowserDynamic
来启动 AppModule
。
3. 项目的配置文件介绍
angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"ionic-rating": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/ionic-rating",
"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/theme.scss"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
ionic-rating An angularjs directive that take care of visualising a star rating bar项目地址:https://gitcode.com/gh_mirrors/io/ionic-rating