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
Mix hashes and standalone values
Bind a class instance returned from a helper
Inline use Note: requires Ember 2.0+ (ie. does not support 1.13)
Inline let declarations are in scope until the parent element or block is closed, for example:
git clone
this repositorynpm install
bower install
ember server
- Visit your app at http://localhost:4200.
npm test
(Runsember try:testall
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit http://ember-cli.com/.
Please note that this project is released with a Contributor Code of
Conduct. By participating in this project you agree to abide by its
terms, which can be found in the CODE_OF_CONDUCT.md
file in this
repository.