DAYANA DEVI S
DAYANA DEVI S

Reputation: 13

Expression inside expression in handebars

Is there any way to put {{expression params={{expression}}}} I have code like this {{name value={{place}}}} where name and place are expressions.The problem is I cannot do this in js and i wanted this to be done in handlebars So is there any way to solve this problem?

Upvotes: 0

Views: 167

Answers (2)

Brookswift
Brookswift

Reputation: 112

You can nest subexpressions in handlebars with parenthesis. A common example is using the hash helper to pass a nested object to a component

{{name value=(hash prop1="a" prop2=(hash sub1="x" sub2="y"))}}

passes the following object to value

{
  prop1: "a",
  prop2: {
    sub1: "x",
    sub2: "y"
  }
}

Upvotes: 0

Lux
Lux

Reputation: 18240

you can do {{expression params=(subexpression)}}.

Upvotes: 2

Related Questions