this repo adds a function to tag-params
library by WebReflections.
this library uses tagParams
as the name in JS.
function MyComponent() {
var year = 1999
var now = new Date().getFullYear()
return tagParams.multiline(function(fn){/*!
<div>
<h1> Hi guys, it's ${year} </h1>
<br><br>
<p>This JavaScript worked <i>${now - year}</i> years ago.</p>
</div>
*/
return eval(fn)
})
}
How does it work?
- JS keeps comments in code.
/*!
tells multiline to string this comment.return eval
can detect the variables for you!tag-params
library finds${
to}
then it is evalled.