Skip to content Skip to sidebar Skip to footer

RactiveJS Events On Tripple Mustache

I have a paging function since it's a little bit tricky to do it in the templates. The problem is that if I place it like this: {{ paging( rows, limit, offset ) }} It will obvious

Solution 1:

Use a partial if you want to add dynamic templating:

data: {
    foo: 'foo',
    paging: function(x){
        var template = '<li on-click="clicked()">' + x + '</li>';
        if (!this.partials.paging) {
            this.partials.paging = template;
        }
        else {
            this.resetPartial('paging', template);
        }
        return 'paging';
    }
},

See http://jsfiddle.net/fz7adjm4/


Post a Comment for "RactiveJS Events On Tripple Mustache"