Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
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 use Note: 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. -- }}
git clone
this repositorynpm install
bower install
ember server
npm test
(Runs ember 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.
FAQs
A helper for binding values to HTMLBars template contexts
We found that ember-let demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.