在ember.js中查找
我想从商店里找到模型。我尝试: 途中:在ember.js中查找,ember.js,ember-data,Ember.js,Ember Data,我想从商店里找到模型。我尝试: 途中: MyApp.EventTalksRoute = Em.Route.extend model: -> MyApp.get('store').findBy('type', 'workshop') MyApp.store.findBy('type', 'workshop') Em.computed.findBy('type', 'workshop') 同样在控制器中: MyApp.EventTalksController =
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不是一个函数”?第一个原因:
我使用findBy。。我应该用过滤比
第二:
我使用了以下内容:
MyApp.TalkGroupTabsView content=model.talkGroups
然后我必须使用
MyApp.TalkGroup = DS.Model.extend
workshops: Em.computed.filterBy 'talksSorted', 'type', 'workshop'
任务完成:)