使用Ember.js预编译Handlebars模板

5
我希望能在我的构建过程中预编译Ember模板。当我尝试使用ember-precompile工具时,生成的函数包含模板数据并将其添加到renderbuffer对象中,但返回一个空字符串,导致未显示任何内容。请注意,保留HTML标记。
Ember.TEMPLATES["ins"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
helpers = helpers || Ember.Handlebars.helpers;
  var buffer = '', stack1, stack2, stack3, foundHelper, tmp1, self=this, escapeExpression=this.escapeExpression;



  data.buffer.push("    <script type=\"text/x-handlebars\" data-template-name=\"FramesInstructions\">\n      Instructions - Click on the frames in the correct order!<br>\n      <a ");
  stack1 = depth0;
  stack2 = "watchCommercial";
  stack3 = helpers.action;
  tmp1 = {};
   debugger
  tmp1.hash = {};
  tmp1.contexts = [];
  tmp1.contexts.push(stack1);
  tmp1.data = data;
  stack1 = stack3.call(depth0, stack2, tmp1);
  data.buffer.push(escapeExpression(stack1) + "> START </a>\n    </script>\n");
  return buffer;
});
1个回答

2

我在模板周围保留了脚本标签。DUR


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接