Skip to content

Commit

Permalink
Merge pull request #12561 from Serabe/feature/contextual-components-d…
Browse files Browse the repository at this point in the history
…ocumentation

[DOC canary] Add documentation for contextual components
  • Loading branch information
mixonic committed Nov 5, 2015
2 parents 1ae26eb + 3845019 commit dee7724
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/ember-htmlbars/lib/keywords/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ import isEnabled from 'ember-metal/features';
{{live-updating-chart}}
```
## Nested Usage
The `component` helper can be used to package a component path with initial attrs.
The included attrs can then be merged during the final invocation.
For example, given a `person-form` component with the following template:
```handlebars
{{yield (hash
nameInput=(component "input" value=model.name placeholder="First Name"))}}
```
The following snippet:
```
{{#person-form as |form|}}
{{component form.nameInput placeholder="Username"}}
{{/person-form}}
```
would output an input whose value is already bound to `model.name` and `placeholder`
is "Username".
@method component
@since 1.11.0
@for Ember.Templates.helpers
Expand Down

0 comments on commit dee7724

Please sign in to comment.