当我尝试通过简单地调用this.store.find('article', { typeId: model.get('typeId') })
加载文章时,得到:
Error while processing route: article Assertion Failed: You tried to load a query but your adapter does not implement `findQuery` Error: Assertion Failed: You tried to load a query but your adapter does not implement `findQuery`
at new Error (native)
at Error.EmberError (http://localhost:4200/assets/vendor.js:21769:23)
at Object.Ember.assert (http://localhost:4200/assets/vendor.js:13266:15)
at Ember.Object.extend.findQuery (http://localhost:4200/assets/vendor.js:71940:15)
at Ember.Object.extend.find (http://localhost:4200/assets/vendor.js:71546:23)
at null.loadData (http://localhost:4200/assets/whatnot.js:70:18)
at applyStr (http://localhost:4200/assets/vendor.js:27968:29)
at sendEvent (http://localhost:4200/assets/vendor.js:22120:13)
at notifyObservers (http://localhost:4200/assets/vendor.js:25560:9)
at propertyDidChange (http://localhost:4200/assets/vendor.js:25363:7)ember.debug.js:25336 logErrorember.debug.js:25293 defaultActionHandlers.errorember.debug.js:25384 triggerEventember.debug.js:50007 triggerember.debug.js:49852 Transition.triggerember.debug.js:49040 finalizeTransitionember.debug.js:48442 (anonymous function)ember.debug.js:50441 tryCatchember.debug.js:50453 invokeCallbackember.debug.js:50424 publishember.debug.js:28563 (anonymous function)ember.debug.js:854 Queue.invokeember.debug.js:919 Queue.flushember.debug.js:724 DeferredActionQueues.flushember.debug.js:149 Backburner.endember.debug.js:204 Backburner.runember.debug.js:223 Backburner.joinember.debug.js:16679 run.joinember.debug.js:39523 __exports__.default.EmberObject.extend._bubbleEventember.debug.js:39474 (anonymous function)jquery.js:4430 jQuery.event.dispatchjquery.js:4116 elemData.handle
我只是想了解一下它是否不适用于某些版本的Ember或尚未实现。
我正在使用
Ember 1.10.0
,emberfire 1.3.2
DEBUG: -------------------------------
DEBUG: Ember : 1.10.0
DEBUG: Ember Data : 1.0.0-beta.14.1
DEBUG: EmberFire : 1.3.2
DEBUG: jQuery : 2.1.3
DEBUG: -------------------------------
和以下
ember-cli
ember -v
version: 0.1.15
Could not find watchman, falling back to NodeWatcher for file system events
node: 0.10.35
npm: 2.1.8
即使使用
Ember 1.9.1
也无法使用DEBUG: -------------------------------
DEBUG: Ember : 1.9.1
DEBUG: Ember Data : 1.0.0-beta.12
DEBUG: EmberFire : 1.3.2
DEBUG: Handlebars : 2.0.0
DEBUG: jQuery : 2.1.3
DEBUG: -------------------------------
https://github.com/firebase/emberfire/issues/179
最佳答案
还没有呢我大约一周前在GitHub上问了这个问题。
但是,尽管未经测试,GitHub用户@tstirrat具有完整的功能。如果您在其PR https://github.com/firebase/emberfire/pull/169中使用该代码,则可以在辩论最终代码时实施解决方法。
语法更接近本机Firebase JS,但我实际上认为这是一个加号。
布伦丹