Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Mustache: only the current context is passed to partials, instead of the full stack. #227
It makes template organization a hassle, since I can't just take a subsection out of template and move it into a partial if it's calling anything up the stack.
I believe this is because when partials are called in can/view/mustache, the value of CONTEXT_STACK.pop() is sent as the object to render. Would it be feasible to send in all of the stack?
I think this behaviour is according to the Mustache spec (Partials section) isn't it?
I think the trick that Handlebars did was not to allow referencing anything up the stack unless you use backtracking paths. Support for backtracking has been filed in #163. I am not sure if Handlebars can backtrack up the stack in a partial though.
I think this makes sense if easy to implement.
Sent from my iPhone
On Jan 9, 2013, at 3:06 PM, "Brad (Bradley) Momberger" email@example.com wrote: