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
functionrenderBase(){returnfunctionrenderBaseInternal(text,renderFn,context){// I propose pass context as third argumentconstcontent=renderFn(text);constnewcontext=context.push({content:content});returnmustache.render(baseTemplate,newContext);}constdata={title:'Awesome title',name:'Horton',baseTemplate:renderBase};constfinalRender=mustache.render(finalTemplate,data);}
The text was updated successfully, but these errors were encountered:
Pass context object to function section as third argument
This allows me to implement limited template inheritance. without changing spec mustache/spec#38
Example
Base Template
And Final template like
And javascript like
The text was updated successfully, but these errors were encountered: