Skip to content

Instantly share code, notes, and snippets.

@magistrula
Last active July 9, 2019 16:49
Show Gist options
  • Select an option

  • Save magistrula/a0f1cf9a4346ee0376da8baae6b3c96a to your computer and use it in GitHub Desktop.

Select an option

Save magistrula/a0f1cf9a4346ee0376da8baae6b3c96a to your computer and use it in GitHub Desktop.
With vs. Let
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'With vs. Let'
});
<h3>WITH (truthy)</h3>
{{#with "I am truthy" as |foo|}}
<div>{{foo}}</div>
{{/with}}
<hr>
<h3>WITH (falsy)</h3>
{{#with null as |foo|}}
<div>{{foo}}</div>
{{/with}}
<hr>
<h3>LET</h3>
{{#let "I am truthy" null "I am truthy too" as |foo bar baz|}}
<div>{{foo}}</div>
<div>{{bar}}</div>
<div>{{baz}}</div>
{{/let}}
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "2.12.2",
"ember-let": "0.7.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment