javascript - handlebars multiple parameters -
here code: left out rest of code (make smaller) cause spits on span paging bootstrap control.
handlebars.registerhelper('pagingcode', function(label, page){ var html = ''; ... return new handlebars.safestring(html); }); html: {{#each paging}} <li> {{pagingcode label page}} </li> {{/each}} array: paging is: [{"label":1,"page":1},{"label":2,"page":2},{"label":3,"page":3},{"label":4,"page":4},{"label":5,"page":5},{"label":"next","page":6}] html output: [object object]1 [object object]2 [object object]3 [object object]4 [object object]5 [object object]6
when inside helper pagingcode page object , label valid value in array. ideas on im doing wrong?
update: ok becuase nginx caching page using old html file compiled.
my answer posted above. because html page being cached , had 1 parameter of label previous code. after forced refresh worked expected.
Comments
Post a Comment