Modstache.fillDOM

Assigns data properties to a DOM fragment by looking for elements with the {} attribute

API call

var fragment = Modstache.fillDOM(target:DOM fragment, data:object, optional options:object);

Returns The passed DOM fragment is modified and returned. The data object is modified based on reactive option.

Example

    var html = '<div {}="value">This is replaced</div>';
        var template = document.createElement("template");
        var data = { value: 'Hello' };

        template.innerHTML = html;
        Modstache.fillDOM(template.content, data, { removeStache: true });
    // template.innerHTML is "<div>Hello</div>"