When a component is included using {{> component args 'foo' 'bar' }} style, the constructor is called something like this: component.constructor( 'foo', 'bar', new Spacebars.kw() )
This caused me a bit of confusion when I wanted an optional last argument to the constructor, since omitting it from the template instanciation did not make it undefined, but rather gave me the empty Spacebars keyword hash.
I thing either the hash should not be in the argument list if it is empty, or the docs should say that it is always the last argument, to avoid similar confusion in the future.
Because this is also how template helpers in general operate (so all class methods) I think I will go with documenting this instead of changing the behavior. But I agree it is ugly.
When a component is included using
{{> component args 'foo' 'bar' }}
style, the constructor is called something like this:component.constructor( 'foo', 'bar', new Spacebars.kw() )
This caused me a bit of confusion when I wanted an optional last argument to the constructor, since omitting it from the template instanciation did not make it undefined, but rather gave me the empty Spacebars keyword hash.
I thing either the hash should not be in the argument list if it is empty, or the docs should say that it is always the last argument, to avoid similar confusion in the future.