-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Hello!
I have a question that I am bringing here only because I couldn't find documentation or other references to this.
Is it possible to overwrite a nested data parameter for a partial ( {{> partial user.name='Laura'}})? Or is this something that requires a helper?
Js Fiddle example
Code that fails to compile
var data = {
"user": {
"name": "Bob"
}
}
Handlebars.registerPartial("user_partial", "{{user.name}}");
// Overwrite the "user.name" parameter when rendering the partial
var template = Handlebars.compile(
"My name is {{> user_partial user[name]='Laura'}}" // throws compiler error
);
document.getElementById('output').innerHTML = template(data);Desired output
My name is LauraThanks
Metadata
Metadata
Assignees
Labels
No labels