我想从商店里找模型。我尝试:在路由中:
MyApp.EventTalksRoute = Em.Route.extend
model: ->
MyApp.get('store').findBy('type', 'workshop')
MyApp.store.findBy('type', 'workshop')
Em.computed.findBy('type', 'workshop')同样在控制器中:
MyApp.EventTalksController = Em.ObjectController.extend
model: ->
MyApp.computed.findBy('type', 'presentation')
workshops: Em.computed.findBy('type', 'workshop')在视图中:
MyApp.EventTalksView = Ember.View.extend
findBy: ['type', 'workshop']
model: ->
Ember.get('store').findBy('type', 'workshop')但它不起作用..在控制台中我有"findBy is not a function"?
发布于 2014-08-11 19:47:16
第一个原因:我使用findBy..我应该使用filterBy..
第二:我使用了内容:
MyApp.TalkGroupTabsView content=model.talkGroups然后我必须使用
MyApp.TalkGroup = DS.Model.extend
workshops: Em.computed.filterBy 'talksSorted', 'type', 'workshop'任务完成:)
https://stackoverflow.com/questions/25241944
复制相似问题