This addon provides a new helper: is-component
to be used as follows:
The helper returns true
when the first parameter can be looked up
a component; false otherwise.
The {{component}}
helper throws an error when
an invalid component name is given as parameter.
Used with {{if}}
, the (is-component)
helper offers a nice failsafe
to avoid the rendering error when the component may not exist:
isComponent: inject(),
exists: computed(function() {
return this.get('isComponent').test('my-component');
})
ember install ember-cli-is-component
ember server
- Visit your app at http://localhost:4200.
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.