Ember CLI addon to render a dynamic component
npm install ember-dynamic-componentAn Ember CLI addon to render a dynamic component.
Install this addon via npm:
```
npm install --save-dev ember-dynamic-component
Give the {{dynamic-component}} helper a type with the name of the component to render, and as that property
changes then the correct component will be rendered:
`handlebars`
{{dynamic-component type=theType}}
Any other properties and actions given to the helper will be passed through to the underlying component:
`handlebars`
{{dynamic-component
type=theType
boundProperty=foo
staticProperty="bar"
onFoo="fooTriggered"
}}
This means the following:
`handlebars`
{{#if showFoo}}
{{x-foo onClick="thingClicked" value=something}}
{{/if}}
{{#if showBar}}
{{x-bar onClick="thingClicked" value=something}}
{{/if}}
{{#if showBaz}}
{{x-baz onClick="thingClicked" value=something}}
{{/if}}
... is essentially the same as:
`handlebars`
{{dynamic-component type=type onClick="thingClicked" value=something}}
* git clone this repositorynpm install
* bower install
*
* ember server
* Visit your app at http://localhost:4200.
* ember testember test --server
*
* ember build`
For more information on using ember-cli, visit http://www.ember-cli.com/.