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
Hi, I have the following code and I want to make this work like template literals. But it does not support invoke methods of variables in template string.
constmustache=require('mustache');functiontest(){constobj={a: 123,b: "HELLO",c: true}// this does not work as expected, rendered as "--true" not "1111011-hello-true"// const exp = "${a.toString(2)}-${b.toLowerCase()}-${c}" constexp="${a}-${b}-${c}"// this works, rendered as "123-hello-true"mustache.tags=['${','}'];constresult=mustache.render(exp,obj,);console.info(`${exp} = ${result}`)}test()
The text was updated successfully, but these errors were encountered:
Hi, I have the following code and I want to make this work like template literals. But it does not support invoke methods of variables in template string.
The text was updated successfully, but these errors were encountered: