【发布时间】:2014-06-25 14:25:29
【问题描述】:
我正在尝试将 Backbone 应用程序慢慢转换为 Angular。准确地说,它实际上是在使用 Marionette。在我当前的每个 Marionette 视图中,它们都是 Marionette.ItemView。为了显示模板,我这样做:
get template() {
return _.template(nameOfMyTemplate, { myModel: this.model });
}
nameOfMyTemplate 将是我的 AwesomeTemplate.template.html 文件,它在我的解决方案中。
我想知道如何只传递我的 template.html 而无需在骨干网或木偶应用程序中调用 _.template?所以在我的主干视图或 marionette.itemview 的某个地方,我可以做
template: NewAwesomeAngularTemplate.template.html // where NewAwesomeAngularTemplate.template.html is a file in my solution
有人遇到过这个吗?我找不到太多关于人们如何将他们的应用程序从 Backbone 或 Marionette 转换为 Angular 的信息。提前致谢!
【问题讨论】:
标签: angularjs templates backbone.js typescript marionette