Ember Animation 演示项目教程

Ember Animation 演示项目教程

ember-animation-demoA presentation at EmberConf 2014项目地址:https://gitcode.com/gh_mirrors/em/ember-animation-demo

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

ember-animation-demo/
├── app/
│   ├── components/
│   ├── controllers/
│   ├── helpers/
│   ├── models/
│   ├── routes/
│   ├── styles/
│   ├── templates/
│   └── index.html
├── config/
│   ├── environment.js
│   └── optional-features.json
├── public/
│   └── assets/
├── tests/
│   ├── acceptance/
│   ├── integration/
│   ├── unit/
│   └── test-helper.js
├── vendor/
├── .editorconfig
├── .ember-cli
├── .gitignore
├── .jshintrc
├── .travis.yml
├── bower.json
├── ember-cli-build.js
├── package.json
├── README.md
└── testem.js

目录结构介绍

  • app/: 包含应用程序的主要代码,包括组件、控制器、助手、模型、路由、样式和模板。
  • config/: 包含应用程序的配置文件,如 environment.jsoptional-features.json
  • public/: 包含公共资源,如图片和字体。
  • tests/: 包含应用程序的测试代码,包括接受性测试、集成测试和单元测试。
  • vendor/: 包含第三方库和插件。
  • .editorconfig, .ember-cli, .gitignore, .jshintrc, .travis.yml: 配置文件,用于编辑器、Ember CLI、Git、JSHint 和 Travis CI。
  • bower.json, ember-cli-build.js, package.json, README.md, testem.js: 项目依赖、构建配置、包管理、项目说明和测试配置文件。

2. 项目的启动文件介绍

app/index.html

这是应用程序的入口文件,包含了基本的 HTML 结构和 Ember 应用程序的初始化代码。

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>EmberAnimationDemo</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {{content-for "head"}}

    <link rel="stylesheet" href="{{rootURL}}assets/vendor.css">
    <link rel="stylesheet" href="{{rootURL}}assets/ember-animation-demo.css">

    {{content-for "head-footer"}}
  </head>
  <body>
    {{content-for "body"}}

    <script src="{{rootURL}}assets/vendor.js"></script>
    <script src="{{rootURL}}assets/ember-animation-demo.js"></script>

    {{content-for "body-footer"}}
  </body>
</html>

ember-cli-build.js

这是 Ember CLI 的构建配置文件,用于配置应用程序的构建过程。

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    // 配置选项
  });

  return app.toTree();
};

3. 项目的配置文件介绍

config/environment.js

这是应用程序的环境配置文件,用于配置不同环境下的设置,如开发、测试和生产环境。

'use strict';

module.exports = function(environment) {
  let ENV = {
    modulePrefix: 'ember-animation-demo',
    environment,
    rootURL: '/',
    locationType: 'auto',
    EmberENV: {
      FEATURES: {
        // 特性配置
      },
      EXTEND_PROTOTYPES: {
        // 原型扩展配置
      }
    },

    APP: {
      // 应用程序配置
    }
  };

  if (environment === 'development') {
    // 开发环境配置
  }

  if (environment === 'test') {
    // 测试环境配置
  }

  if (environment === 'production') {
    // 生产环境配置
  }

  return ENV;
};

config/optional-features.json

这是可选特性的配置文件,用于启用或禁用某些 Ember 特性。

{
  "jquery-integration": false,
  "template-only-glimmer-components": true
}

通过以上介绍,您可以更好地理解和使用 Ember Animation 演示项目。希望这篇教程对您有所帮助!

ember-animation-demoA presentation at EmberConf 2014项目地址:https://gitcode.com/gh_mirrors/em/ember-animation-demo

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

谭伦延

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

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

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

打赏作者

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

抵扣说明:

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

余额充值