javascript - Delivering precompiled Handlebars Template on demand via JSON -
i want deliver handlebars templates ember.js application on demand via ajax -request. i'm able compile on server , i'm able deliver following output ( function ) string : ember.templates["authentication"] = ember.handlebars.template(function anonymous(handlebars,depth0,helpers,partials,data) { this.compilerinfo = [2,'>= 1.0.0-rc.3']; helpers = helpers || ember.handlebars.helpers; data = data || {}; var buffer = '', stack1, hashtypes, options, helpermissing=helpers.helpermissing, escapeexpression=this.escapeexpression; data.buffer.push("<h1>hooray! works!</h1>\r\n"); hashtypes = {}; options = {hash:{},contexts:[depth0],types:["id"],hashtypes:hashtypes,data:data}; data.buffer.push(escapeexpression(((stack1 = helpers.outlet),stack1 ? stack1.call(depth0, "main", options) : helpermissing.call(depth0, "outlet", "main", options)))); return buffer; }); this string i'...