Variable in attribute value of XML-literal Variable in attribute value of XML-literal xml xml

Variable in attribute value of XML-literal


You put the whole thing inside the brackets:

<a href={ "page?param=" + id }>link</a>


The answer to put it all in curly braces is correct. But don't forget that you need to have a string in the curly braces!

So, you have to write something like (not your example, obviously)

<edge label={name} weight={weight.toString} />

If you come from a language which converts types for you, it can cost you a few minutes of head scratching before you remember what's wrong, because SBT offers no error message, just underlines it.


Using this , you won't miss the quotes : <a href={s"page?param=$Id"}>link</a>