Skip to content

Commit

Permalink
[DOC lts] Addressed PR comments
Browse files Browse the repository at this point in the history
(cherry picked from commit 5c9b6e1)
  • Loading branch information
DanMonroe authored and kategengler committed Feb 12, 2019
1 parent 71c2fe5 commit 8a42b3b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
8 changes: 6 additions & 2 deletions packages/@ember/-internals/glimmer/lib/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ export const BOUNDS = symbol('BOUNDS');
```app/templates/components/my-foo.hbs
<PersonProfile @person={{this.currentUser}} />
```
or
```app/templates/components/my-foo.hbs
{{person-profile person=currentUser}}
{{person-profile person=this.currentUser}}
```
```app/templates/components/person-profile.hbs
Expand All @@ -68,9 +69,10 @@ export const BOUNDS = symbol('BOUNDS');
{{! Executed in the controller's context. }}
</PersonProfile>
```
or
```handlebars
{{#person-profile person=currentUser}}
{{#person-profile person=this.currentUser}}
<p>Admin mode</p>
{{! Executed in the controller's context. }}
{{/person-profile}}
Expand Down Expand Up @@ -474,7 +476,9 @@ export const BOUNDS = symbol('BOUNDS');
<h3>Fisherman Industries</h3>
</PersonProfile>
```
or
```handlebars
{{#person-profile}}
<h2>Chief Basket Weaver</h2>
Expand Down
3 changes: 2 additions & 1 deletion packages/@ember/-internals/glimmer/lib/helpers/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@
```
<PersonForm as |form|>
{{form.nameInput placeholder="Username"}}
<form.nameInput @placeholder={{"Username"}} />
</PersonForm>
```
or
```
{{#person-form as |form|}}
Expand Down
10 changes: 8 additions & 2 deletions packages/@ember/-internals/glimmer/lib/helpers/if-unless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ class ConditionalHelperReference extends CachedReference {
You can use the `if` helper inside another helper as a nested helper:
```handlebars
<SomeComponent height=(if isBig "100" "10") />
<SomeComponent height={{if isBig "100" "10"}} />
```
or
```handlebars
{{some-component height=(if isBig "100" "10")}}
```
Expand Down Expand Up @@ -154,8 +157,11 @@ export function inlineIf(_vm: VM, { positional }: Arguments) {
You can use the `unless` helper inside another helper as a subexpression.
```handlebars
<SomeComponent height=(unless isBig "10" "100") />
<SomeComponent height={{unless isBig "10" "100"}} />
```
or
```handlebars
{{some-component height=(unless isBig "10" "100")}}
```
Expand Down
5 changes: 5 additions & 0 deletions packages/@ember/-internals/glimmer/lib/helpers/mut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import { INVOKE, UPDATE } from '../utils/references';
```handlebars
<MyChild @childClickCount={{action (mut totalClicks)}} />
```
or
```handlebars
{{my-child childClickCount=(mut totalClicks)}}
```
Expand All @@ -40,7 +43,9 @@ import { INVOKE, UPDATE } from '../utils/references';
```handlebars
<MyChild @childClickCount={{this.totalClicks}} @click-count-change={{action (mut totalClicks))}} />
```
or
```handlebars
{{my-child childClickCount=totalClicks click-count-change=(action (mut totalClicks))}}
```
Expand Down

0 comments on commit 8a42b3b

Please sign in to comment.