Skip to content

Start example

Ilya edited this page Jan 18, 2017 · 1 revision
// index.js import Aromatic from './src/Aromatic';

let node = document.querySelector('#test');
let some = { foo : 'light', foo2 : 'some' ,

deep : {
name : 'Yee
}
Aromatic.compile(node.innerHTML, some);

// first parameter is your original string
// second parameter is the object with data

// to get generated html, just call getHtml node.innerHTML = Aromatic.getHtml();

// What to find in html?

// index.html
<div id="test">
<div>{{ foo }}</div>
<div>{{ foo2 }}</div>
<div>{{ deep.name }}</div>
</div>

Clone this wiki locally