【发布时间】:2013-01-24 02:08:43
【问题描述】:
我正在尝试使用 Ember 的 pre4 版本,但在路由器上卡住了。
我收到一条错误消息,上面写着Uncaught TypeError: Cannot Call method 'map' of undefined。
相关代码:
App.Router.map(function() {
this.route("about", { path: "/about" });
this.route("favorites", { path: "/favs" });
});
我已经加载了 Ember.js 和 jQuery。 Ember pre4 也会抛出错误:Uncaught TypeError: Object prototype may only be an Object or null。
我做错了吗?指南没有更新吗?
我目前的代码:
window.App = Ember.Application.create({
ApplicationView: Ember.View.extend({
templateName: 'application'
}),
ApplicationController: Ember.Controller.extend({
}),
SiteView: Em.View.extend({
templateName: 'site-template'
}),
SiteController: Em.ArrayController.extend(),
});
App.Router.map(function() {
this.route("about", { path: "/about" });
this.route("favorites", { path: "/favs" });
});
【问题讨论】:
标签: ember.js ember-router