2
我想从服务器上传ember模板。 我看到对于那些需要使用的,如:灰烬。实时上传模板
$.ajax({
url: 'url_to_template_text',
dataType: 'text',
success: function (resp) {
App.AboutView = Ember.View.extend({
template: Ember.Handlebars.compile(resp)
});
}
});
但我无法理解如何渲染页面上这一观点。 App.AboutView.append(中) - 不工作
如果添加路由的这一观点,那么就没有时间来呈现越来越模板:
<script type="text/x-handlebars" >
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="about">
That text cant be show
</script>
//////JS
$.ajax({
url: 'url_to_template_text',
dataType: 'text',
success: function (resp) {
App.AboutView = Ember.View.extend({
templateName: 'about',
template: Ember.Handlebars.compile(resp)
});
}
});
App.Router.map(function() {
this.route("about", { path: "/" });
});
没有奏效过。渲染最古老的模板内容(我的意思是“那个文本不能显示”)
请帮助我,也许我用坏的方式?
谢谢,它为我工作 –