Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply modifications for 4.11 guides (#171)
- Loading branch information
1 parent
f1015da
commit efa9ba7
Showing
34 changed files
with
276 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
In Ember, rendering occurs via syntax, rather than by value -- so _anything_ can be a modifier, helper, or component. | ||
|
||
## Modifiers | ||
|
||
For Modifiers, there is a specific syntax that only modifiers may reside in | ||
```hbs | ||
<div {{someModifier}}> | ||
``` | ||
or via property on some object | ||
```hbs | ||
<div {{this.property.someModifier}}> | ||
``` | ||
or via an argument passed to a component | ||
```hbs | ||
<div {{@someModifier}}> | ||
``` | ||
|
||
Modifiers can be curried with the `modifier` helper: | ||
```hbs | ||
{{! In a component called "Example" }} | ||
{{yield (modifier someModifier "arguments" "here")}} | ||
{{! Usage: }} | ||
<Example as |theModifier|> | ||
<div {{theModifier}}> | ||
</Example> | ||
``` | ||
|
||
|
||
## Helpers | ||
|
||
For Helpers, there is a specific syntax that only helpers may reside in | ||
```hbs | ||
{{ (theHelper) }} | ||
``` | ||
or nested in a sub-expression | ||
```hbs | ||
{{yield (hash key=(theHelper) key2=(theHelper with args)) }} | ||
``` | ||
or via property on some object | ||
```hbs | ||
{{ (this.property.theHelper) }} | ||
``` | ||
or via an argument passed to a component | ||
```hbs | ||
{{ (@theHelper) }} | ||
``` | ||
|
||
Helpers can be curried with the `helper` helper: | ||
```hbs | ||
{{! In a component called "Example" }} | ||
{{yield (helper someHelper "arguments" "here")}} | ||
{{! Usage: }} | ||
<Example as |theHelper|> | ||
{{ (theHelper) }} | ||
</Example> | ||
``` | ||
|
||
## Components | ||
|
||
For Components, there is a specific syntax that only components may reside in | ||
```hbs | ||
<AComponent /> | ||
``` | ||
or via a property on some object | ||
```hbs | ||
<this.someComponent /> | ||
``` | ||
or via an argument passed to a component | ||
```hbs | ||
<@someComponent /> | ||
``` | ||
|
||
Components can be curried with the `component` helper: | ||
```hbs | ||
{{! | ||
In a component called "Example". | ||
Note that components may only receive named arguments | ||
}} | ||
{{yield (component someComponent foo="arguments" bar="here")}} | ||
{{! Usage: }} | ||
<Example as |theComponent|> | ||
<theComponent /> | ||
</Example> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.