Ember.Component shouldn't require a template
Currently you can have a template-only component, but not a class-only component.
Lots of components are simply an element and aren't intended to have anything to {{yield}}.
Ember should be happy to take a component where only the JS class is defined, ie:
App.XAwesomeButtonComponent = Ember.Component.extend();
As I was in this code yesterday fix things, I was also thinking of this.
There are several Component related funky things, especially since they are directly integrated with template helpers
https://github.com/emberjs/ember.js/blob/master/packages/ember-handlebars/lib/loader.js#L61-L87
Agree.
Really weird to have templates like:
<script type="text/x-handlebars" id="components/mycomp">
</script>
I agree completely. My only issue would be how to infer where the dash goes (for container lookup). We could just infer after the first word and allow overriding...
@rjackson maybe they require explicit templateNames set? or a helperName property?
dashes are easy, just dasherize the title case.
FooBarBazComponent -> foo-bar-baz
A component should never be foo-barBaz, it doesn't map to web components.
@rpflorence That makes it much easier. Was thinking we had to support the other pattern also...
@rpflorence interesting..
Components that are defined in JS and registered with .helper no longer get an implicit template.
For anyone stumbling along later: http://emberjs.com/api/classes/Ember.Handlebars.html#method_helper
So, is it possible to have a Component that doesn't have a template? If so then how? If not, then I think that it should be supported. I've just raised a discussion about component templates on discuss.emberjs.com if anyone's interested.
@aexmachina - It is definitely possible. You need to register the handlebars helper manually.
Ember.Handlebars.helper('my-component-name', App.MyComponentName);
Example here.
@rwjblue Your example no longer works in 1.8. Is this still possible? Thanks
@rwjblue we used that trick on 1.6, now we are starting a new project with 2.2 and that function doesn't exists anymore. Is there a working solution for 2.2?