handlebars.js - How to execute a Javascript callback when a partial is rendered in Handlebars -


i've created custom class in js wraps handlebars, way can execute callback when template has been rendered, since partials in handlebars automatically generated, how execute callback when partial rendered ?

i've tried override '>' helper doesn't work... , have no idea how otherwise.

thank guys help.

handlebars runtime calls method handlebars.vm.invokepartial exec partial. can override adding callback function call:

handlebars.vm.invokepartialorigin = handlebars.vm.invokepartial; handlebars.vm.invokepartial = function () {   var args = [].slice.call(arguments, 0);   handlebars.vm.invokepartialorigin.apply(handlebars.vm, args);   callback(args); }; 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -