ngx-dnd 项目教程

ngx-dnd 项目教程

ngx-dnd🕶 Drag, Drop and Sorting Library for Angular2 and beyond!项目地址:https://gitcode.com/gh_mirrors/ng/ngx-dnd

1. 项目的目录结构及介绍

ngx-dnd 项目的目录结构如下:

ngx-dnd/
├── 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
│   ├── polyfills.ts
│   ├── styles.css
│   ├── test.ts
│   ├── tsconfig.app.json
│   ├── tsconfig.spec.json
│   ├── typings.d.ts
├── angular.json
├── package.json
├── tsconfig.json
├── tslint.json

目录结构介绍

  • e2e/: 包含端到端测试的文件。

    • src/: 包含测试脚本。
    • protractor.conf.js: Protractor 配置文件。
    • tsconfig.json: TypeScript 配置文件。
  • 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: 应用程序的入口 HTML 文件。
    • main.ts: 应用程序的入口 TypeScript 文件。
    • polyfills.ts: 包含浏览器兼容性填充代码。
    • styles.css: 全局样式文件。
    • test.ts: 测试配置文件。
    • tsconfig.app.json: 应用程序的 TypeScript 配置文件。
    • tsconfig.spec.json: 测试的 TypeScript 配置文件。
    • typings.d.ts: TypeScript 类型定义文件。
  • angular.json: Angular CLI 配置文件。

  • package.json: 包含项目的依赖和脚本。

  • tsconfig.json: 根 TypeScript 配置文件。

  • tslint.json: TSLint 配置文件。

2. 项目的启动文件介绍

main.ts

main.ts 是 Angular 应用程序的入口文件,负责启动应用程序。以下是 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));

文件介绍

  • enableProdMode(): 启用生产模式,禁用 Angular 的开发模式特性。
  • platformBrowserDynamic(): 使用 JIT (Just-In-Time) 编译器在浏览器中动态编译和启动 Angular 应用程序。
  • bootstrapModule(AppModule): 启动应用程序的根模块 AppModule

3. 项目的配置文件介绍

angular.json

angular.json 是 Angular CLI 的配置文件,包含项目的构建和开发服务器配置。以下是 angular.json 的部分内容:

{
  "$

ngx-dnd🕶 Drag, Drop and Sorting Library for Angular2 and beyond!项目地址:https://gitcode.com/gh_mirrors/ng/ngx-dnd

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

芮伦硕

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值