我正在使用外部模板
Ember.TEMPLATES["application"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [2,'>= 1.0.0-rc.3'];
helpers = helpers || Handlebars.helpers; data = data || {};
var stack1, functionType="function", escapeExpression=this.escapeExpression;
if (stack1 = helpers.outlet) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.outlet; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
return escapeExpression(stack1);
});
Ember.TEMPLATES["teams"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [2,'>= 1.0.0-rc.3'];
helpers = helpers || Handlebars.helpers; data = data || {};
var buffer = "", stack1, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
buffer += "<div class=\"container-fluid hero team-banner\"><i class=\"icon-cheer\"></i><h1>Fan a Team</h1><span>Choose one or more teams from the list below to get started.</span></div><div class=\"container\"><div class=\"row-fluid team-tab\"><ul class=\"row-fluid nav nav-tabs\"><li class=\"active\"><a>3A</a></li><li><a>2A</a></li><li><a>1A</a></li><li class=\"title\">Conference:</li></ul></div><div class=\"tab-content\"><div class=\"row-fluid tab-pane active\"><div class=\"row-fluid division\"><div class=\"row-fluid division-header\">";
options = {hash:{},data:data};
buffer += escapeExpression(((stack1 = helpers.Team),stack1 ? stack1.call(depth0, depth0.Name, options) : helperMissing.call(depth0, "Team", depth0.Name, options)))
+ "</div><div class=\"row-fluid division-content\"><table class=\"table table-bordered\"><tr><td class=\"team-logo\"><div class=\"img-wrapper\"></div></td><td class=\"name\">Golden St. Elites, Golden Eagles</td><td class=\"location\">San Mateo, CA</td><td class=\"options\"></td></tr><tr><td class=\"team-logo\"><div class=\"img-wrapper\"></div></td><td class=\"name\">Golden St. Elites, Golden Eagles</td><td class=\"location\">San Mateo, CA</td><td class=\"options\"><input /></td></tr><tr><td class=\"team-logo\"><div class=\"img-wrapper\"></div></td><td class=\"name\">Golden St. Elites, Golden Eagles</td><td class=\"location\">San Mateo, CA</td><td class=\"options\"><input /></td></tr><tr><td class=\"team-logo\"><div class=\"img-wrapper\"></div></td><td class=\"name\">Golden St. Elites, Golden Eagles</td><td class=\"location\">San Mateo, CA</td><td class=\"options\"><input /></td></tr></table></div></div></div><div class=\"text-centered\"><a class=\"btn btn-large btn-success\">Start Spinning</a></div></div></div>";
return buffer;
});
我可以确认加载而不是抛出错误。
然后我有我的应用程序控制器和团队控制器,两者都被加载而不会抛出错误。
App.ApplicationController = Ember.Controller.extend();
App.TeamsController = Ember.Controller.extend
content: []
然后我的视图被加载而不是抛出错误并与模板相关
App.ApplicationView = Ember.View.extend({
templateName: "application"
});
App.TeamsView = Ember.View.extend({
templateName: "teams"
});
最后我有一台路由器
App.Router.map ->
this.route('teams', {path: '/'})
我很困惑它甚至知道从外部模板中插入插座的位置。
我也不知道路由器是否重要但页面位于'/teams.html'而不是'/'
如果有人可以提供帮助,我很欣赏它,我只需要知道如何开始这项工作,现在我看不到任何生命迹象。
如果语法看起来很糟糕,我一直在慢慢地将一些东西转换成coffeescript。
DEBUG: -------------------------------
DEBUG: Ember.VERSION : 1.0.0-rc.1
DEBUG: Handlebars.VERSION : 1.0.0-rc.3
DEBUG: jQuery.VERSION : 1.9.1
DEBUG: -------------------------------