<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>List</title>
</head>
<body>
<div id="container"></div>

<script id="tmpl" type="text/html">
    <ul>
        <% for (var i = 0, len = list.length; i < len; i++) {%>
            <li><%=$helpers.format(list[i])%></li>
        <%}%>
    </ul>
</script>
<script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../../../dist/gmp.js"></script>
<script>
    GMP.template.helper('format', function(name) {
      return 'nb' + name;
    });

    new GMP({
        el: '#container',
        data: {
            list: ['鸣人', '佐助', '我爱罗', '春野樱']
        },
        template:GMP.template('tmpl'),
        init: function(){
            this.render();
        },
        render: function() {
            $('#container').html(this.template(this.data));
        }
    });
</script>
</body>
</html>