Emberjs咕噜模板编译器

时间:2014-07-20 17:22:14

标签: javascript ember.js gruntjs handlebars.js

我正在尝试使用Grunt为我的Ember应用程序预编译我的.hbs模板。正在使用的Grunt项目:

https://www.npmjs.org/package/grunt-ember-templates

我让Grunt工作得很好,正在编译单个templates.js文件:

Ember.TEMPLATES["dashboard/dashboard"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
    this.compilerInfo = [4,'>= 1.0.0'];
    helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};

    data.buffer.push("<script type=\"text/x-handlebars\" data-template-name=\"dashboard\"> Dashboard </script>");
});

以下是路线档案:

App.Router.map(function() {
    this.route('dashboard', { path: '/dashboard' });
});

这是index.php文件:

<body>
    <script type="text/x-handlebars">
        {{outlet}}
    </script>
</body>

但是,当我到达localhost / app /#/ dashboard的路径时,&#34; Dashboard&#34;文本无法显示。我错过了一些明显的东西吗我试着谷歌搜索解决方案,但无法找到任何东西。我确实试过放置&#34;仪表板/仪表板&#34;作为this.route(templatenamehere)中的模板名称,...但是产生了以下错误:

&#34;无法读取属性&#39; ember_meta &#39;未定义的TypeError:无法读取属性&#39; ember_meta &#39;未定义&#34;

提前致谢

0 个答案:

没有答案
相关问题