Skip to content

Adding documentation for passing arguments into partials#984

Merged
kpdecker merged 2 commits intohandlebars-lang:masterfrom
johneke:master
Mar 24, 2015
Merged

Adding documentation for passing arguments into partials#984
kpdecker merged 2 commits intohandlebars-lang:masterfrom
johneke:master

Conversation

@johneke
Copy link
Copy Markdown
Contributor

@johneke johneke commented Mar 19, 2015

Great feature!!! However I only found it on stack overflow, pull requests, and github issues after spending lots of time searching for how to do this.

It would be awesome if this was right in the handlebars docs!

@zordius
Copy link
Copy Markdown

zordius commented Mar 19, 2015

This example cause error:

Uncaught Error: Parse error on line 1:
...tOfPeople rosterName}}
-----------------------^
Expecting 'EQUALS', got 'CLOSE'

I tried it with http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-ab96073.js
JSfiddle: http://jsfiddle.net/udxn4wkt/1/

When I change source to {{> roster people=listOfPeople}} , it works well.

@johneke
Copy link
Copy Markdown
Contributor Author

johneke commented Mar 19, 2015

Thanks @zordius!! I just wanted to show an example which had both a hash parameter and a context parameter.

I've updated :)

kpdecker added a commit that referenced this pull request Mar 24, 2015
Adding documentation for passing arguments into partials
@kpdecker kpdecker merged commit 1d401a2 into handlebars-lang:master Mar 24, 2015
@kpdecker kpdecker added this to the 3.0.1 milestone Mar 24, 2015
@kpdecker
Copy link
Copy Markdown
Collaborator

Released in 3.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants