-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC#286 | Implement block let helper as syntax #16076
Conversation
b08938d
to
0612091
Compare
0612091
to
060e47b
Compare
|
||
```handlebars | ||
{{#let | ||
(concat post ' | The Ember.js Blog' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick, (concat post ' | The Ember.js Blog')
return `{{#let ${cond} as |test|}}${truthy}{{else}}${falsy}{{/let}}`; | ||
} | ||
|
||
['@test keying off of `undefined` does not render']() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the description a little hard to parse. Perhaps something like @test a key with an undefined value renders nothing
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, the tests were adapted from {{with}}
and this should not actually pass 🤔 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It passes because undefined
renders as ``, hah. Adapted the test for {{let}}
.
6d592ac
to
8c48a63
Compare
{{/let}} | ||
``` | ||
|
||
@method let |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what other annotations to put here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @toddjordan
8c48a63
to
056feb1
Compare
that receives a lot of options and you want to clean up the invocation. | ||
|
||
For the following example, the template receives a `post` object with | ||
`content` and `title` properties, and a `user` object with `firstName` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a user
object passed in the example below, maybe that was from a prior iteration?
`content` and `title` properties, and a `user` object with `firstName` | ||
and `lastName` properties. | ||
|
||
We are going to call the `my-post` component, passing a title with is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/with is/which is/
056feb1
to
614e893
Compare
614e893
to
69c1628
Compare
I have started implementing RFC#286 so developers can start trying it out.
Tasks
let