0
我試圖與Ember的pre4版本一起工作,但我在路由器上卡住了。Ember的路由器pre4
我收到一個錯誤,說Uncaught TypeError: Cannot Call method 'map' of undefined
。
Relavent代碼:
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" });
});
謝謝!我缺少'handlebar.js',需要使用非縮小版本。謝謝你指出我。 – RyanJM