本文介绍了emberfire 1.3.2是否执行findQuery方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过简单地调用 this.store.find('article',{typeId:model.get('typeId')})获取:

 处理路由时出错:文章断言失败:您尝试加载查询,但您的适配器不实现`findQuery'错误:断言失败:您尝试加载查询,但您的适配器未在Error.EmberError(http:// localhost:4200 / assets / vendor)处的新错误(本机)
上实现`findQuery`
.js:21769:23)
在Object.Ember.assert(http:// localhost:4200 / assets / vendor.js:13266:15)
在Ember.Object.extend.findQuery(http :// localhost:4200 / assets / vendor.js:71940:15)
在Ember.Object.extend.find(http:// localhost:4200 / assets / vendor.js:71546:23)
at null.loadData(http:// localhost:4200 / assets / whatnot.js:70:18)
在applyStr(http:// localhost:4200 / assets / vendor.js:27968:29)
在sendEvent(http:// localhost:4200 / assets / vendor.js:22120:13)
at noti fyObservers(http:// localhost:4200 / assets / vendor.js:25560:9)
在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 triggerederember.debug.js:49852 Transition.triggerember.debug.js:49040 finalizeTransitionember.debug.js:48442(anonymous函数)ember.debug.js:50441 tryCatchember.debug.js:50453 invokeCallbackember.debug.js:50424 publishember.debug.js:28563(匿名函数)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(匿名函数)jquery.js:4430 jQuery.event.dispatchjquery.js:4116 elemData.handle

我只是要求fi找出是否不使用某些版本的Ember或者是否尚未实现。



我正在使用 Ember 1.10.0 emberfire 1.3.2

 调试: ------------------------------- 
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 
版本:0.1。 15
无法找到守望者,回到NodeWatcher进行文件系统事件
节点:0.10.35
npm:2.1.8

即使使用 Ember 1.9.1

 调试:------------------------------- 
DEBUG:Ember:1.9.1
DEBUG:Ember数据:1.0.0-beta.12
DEBUG:EmberFire:1.3.2
DEBUG:Handlebars:2.0.0
DEBUG :jQuery:2.1 .3
DEBUG:-------------------------------

解决方案

还没有。我刚刚在GitHub上问了这个问题。



然而,GitHub用户@tstirrat虽然没有经过验证,但功能完整。如果您在其PR ,那么你可以在最后的代码被辩论时实现一个解决方法。



语法更接近本机的Firebase JS,但我实际上认为这是一个加号。 p>

Brendan


When I tried to load articles by simply calling this.store.find('article', { typeId: model.get('typeId') }), I get:

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

I am just asking to find out whether it is not working with certain versions of Ember or whether it has not been implemented yet.

I am using 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: -------------------------------

and the following 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

It doesn't work even with 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

解决方案

It does not yet. I asked this very question a week or so ago on GitHub.

However, GitHub user @tstirrat has a fully functional although untested implementation. If you use the code in his PR https://github.com/firebase/emberfire/pull/169 then you can implement a workaround while the final code is debated.

Syntax is closer to native Firebase JS but I actually think that is a plus.

Brendan

这篇关于emberfire 1.3.2是否执行findQuery方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 00:15