fix(js/templating.js): #934 - fix IE8 and older