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
Post a Comment