我正在使用外部模板
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' 而不是 '/'
如果有人可以提供帮助,我将不胜感激,我只需要知道如何开始,现在我看不到任何生命迹象。
如果语法看起来不对,我一直在慢慢地将一些东西转换为咖啡脚本。
DEBUG: -------------------------------
DEBUG: Ember.VERSION : 1.0.0-rc.1
DEBUG: Handlebars.VERSION : 1.0.0-rc.3
DEBUG: jQuery.VERSION : 1.9.1
DEBUG: -------------------------------