Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Template inclusion helper should accept keyword arguments #19

Closed
zdexter opened this issue Mar 30, 2014 · 2 comments
Closed

Template inclusion helper should accept keyword arguments #19

zdexter opened this issue Mar 30, 2014 · 2 comments

Comments

@zdexter
Copy link

zdexter commented Mar 30, 2014

+myTemplate arg1=arg1 arg2=arg2

does not work:

While building the application:
<runJavaScript-6>:130:11: Expected space
{{>myTemplate arg1=arg1,}}

Per the Blaze wiki:

"New: (Notably, in Blaze, keyword arguments to inclusion or block helpers are bundled into a single object which becomes the new data context)"

The example given on the Wiki happens to be a dynamic template rendering pattern, which makes this seem more complicated than it actually is, but it's clear that keyword arguments are bundled into the data context and are accessible from the template.

As expected, the following works:

{{> myTemplate arg1=arg1 arg2=arg2}}
@mquandalle mquandalle added the bug label Mar 30, 2014
@zdexter zdexter changed the title Templates should accept keyword arguments Template include helper should accept keyword arguments Mar 30, 2014
@zdexter zdexter changed the title Template include helper should accept keyword arguments Template inclusion helper should accept keyword arguments Mar 30, 2014
@mquandalle
Copy link
Owner

Fixed in 0.2.1

@vojto
Copy link

vojto commented Apr 5, 2014

It doesn't work with brackets now:

+myTemplate(arg1=arg1 arg2=arg2)

Version 0.2.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants