使用最新(來自GitHub)Ember和Ember數據,此代碼給我一個錯誤 - 未捕獲TypeError:無法讀取未定義的屬性'find'燼數據-latest.js:3170Ember數據 - 未捕獲TypeError:無法讀取未定義的屬性'find'
// only needed on JSFiddle; this is to trigger the route
history.pushState("", "", "/projects/1/tasks");
App = Ember.Application.create({});
App.store = DS.Store.extend({
revision: 4,
adapter: DS.RESTAdapter.create()
});
App.Project = DS.Model.extend({
name: DS.attr('string')
});
App.ApplicationController = Ember.ObjectController.extend({
});
App.ApplicationView = Ember.View.extend({
templateName: 'application'
});
App.TasksView = Ember.View.extend({
templateName: 'tasks'
});
App.Router = Ember.Router.extend({
root: Ember.Route.extend({
tasks: Ember.Route.extend({
route: '/projects/:project_id/tasks',
connectOutlets: function(router) {
router.get('applicationController').connectOutlet('Tasks');
}
})
})
});
App.router = App.Router.create({
location: 'history'
});
App.initialize(App.router);
更改:projects_id到別的途徑(例如:1,所以它的URL匹配)修復了這個,但當然這不是非常有用。
任何人都可以點亮這裏發生的一切嗎?謝謝!
我實際上是這樣做的:使用DS.Store.create()並保持App.store的小寫。 – pjmorse 2012-08-31 17:48:43