当前位置: 首页 > 软件库 > 程序开发 > >

ember-let

授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 衡高寒
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

ember-let

ember-let is an addon for binding variables to template contexts in Ember. It behaves much like the with helper, but lets you bind an arbitrary number of variables, including standalone values, hashes, and class instances. However, unlike with, the let helper will yield its block even if the bound values are undefined, null, or []. This has the benefit of allowing the user to treat the block values as true variable bindings rather than simply aliases to existing values.

See examples below:

Bind basic values

{{#let "abc" "123" as |first second|}}
  <li>{{first}}</li>
  <li>{{second}}</li>
{{/let}}

Mix hashes and standalone values

{{#let (hash first="first" second="second") "third" as |hash standalone|}}
  <li>{{hash.first}}</li>
  <li>{{hash.second}}</li>
  <li>{{standalone}}</li>
{{/let}}

Bind a class instance returned from a helper

{{#let (boolean) as |bool|}}
  {{bool.value}} - <button onClick={{action bool.toggle}}>toggle</button>
{{/let}}

Inline useNote: requires Ember 2.0+ (ie. does not support 1.13)

{{let greeting=(concat "hello " to)}}
{{greeting}} - <button {{action (action (mut to) "world")}}>Greet the world!</button>

Inline let declarations are in scope until the parent element or block is closed, for example:

{{#if person.isActive}}
  <div>
    {{let name=person.name}}
    <span>{{name}}</span>
  </div>
  {{!-- The name binding is not accessible here... --}}
{{/if}}
{{!-- ...or here. -- }}

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://ember-cli.com/.

Code of Conduct

Please note that this project is released with a Contributor Code ofConduct. By participating in this project you agree to abide by itsterms, which can be found in the CODE_OF_CONDUCT.md file in thisrepository.

  • Ember controller之间通信 使用Ember做项目有一段时间了,查看项目之前的代码,当一个controller用到另一个controller的数据时,总是使用将变量存到localStorage中的方法,虽然这种方式是可以实现功能的,但是有很多局限性: 1、无法直接监听localstorage的变化 2、localStorage本质上是对字符串的读取,如果存储内容多的话会消耗内存空间,导

  • Ember Models 在目前的项目工作中,我们(特指Pharbers项目)还没有完全使用 Ember Models的一些原生的 特性,都是经过了一层封装,但是在 BM 项目中已经开始使用完全符合 JSONAPI 以及 Ember Data 的规范。所以这里完全是按照官方的符合JSONAPI 的规范。 Fetch Record 获取 全部的 records 有两种方法: // route.js

  • 以ember框架为例: 封装的service: import Service from '@ember/service' import { inject as service } from "@ember/service" import fetch from 'fetch' import { tracked } from '@glimmer/tracking' import { action }

  • 在Ember应用中适配器决定了数据保存到后台的方式,比如URL格式和请求头部。Ember Data默认的适配器是内置的REST API回调。        实际使用中经常会扩展默认的适配器。Ember的立场是应该通过扩展适配器来添加不同的功能,而非添加标识。这样可以使得代码更加容易测试、更加容易理解,同时也降低了可能需要扩展的适配器的代码。        如果你的后端使用的是Ember约定的规则那

 相关资料
  • Ember检查器是一个浏览器插件,用于调试Ember应用程序。 灰烬检查员包括以下主题 - S.No. 灰烬检查员方式和描述 1 安装Inspector 您可以安装Ember检查器来调试您的应用程序。 2 Object Inspector Ember检查器允许与Ember对象进行交互。 3 The View Tree 视图树提供应用程序的当前状态。 4 检查路由,数据选项卡和库信息 您可以看到检查

  • 英文原文: http://emberjs.com/guides/getting-ember/index/ Ember构建 Ember的发布管理团队针对Ember和Ember Data维护了不同的发布方法。 频道 最新的Ember和Ember Data的 Release,Beta 和 Canary 构建可以在这里找到。每一个频道都提供了一个开发版、最小化版和生产版。更多关于不同频道的信息可以查看博客

  • ember-emojione ember-emojione is your emoji solution for Ember, based on the EmojiOne project. EmojiOne version 2 is used, which is free to use for everyone (CC BY-SA 4.0), you're only required to giv

  • Ember 3D Ember 3D is an Ember addon for using Three.js - an easy to use, lightweight, javascript 3D library. It is designed to: Prescribe a solid file structure to Three.js code using ES6 modules. Ena

  • Ember Table An addon to support large data set and a number of features around table. Ember Table canhandle over 100,000 rows without any rendering or performance issues. Ember Table 3.x supports: Emb

  • vscode-ember This is the VSCode extension to use the Ember Language Server. Features All features currently only work in Ember-CLI apps that use classic structure and are a rough first draft with a lo