Skip to content

Commit

Permalink
Add documentation for closure component
Browse files Browse the repository at this point in the history
  • Loading branch information
Serabe committed Nov 5, 2015
1 parent 1ae26eb commit 3845019
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 3845019

Please sign in to comment.