You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: