了解Firebase承诺API

时间:2016-05-09 14:37:58

标签: javascript node.js firebase

所以,这是我的代码:

var root = new Firebase( "https://dummydummydummy.firebaseio.com/" );
var user = root.child("people").child(service).child(id);
user.once("value").then(function(snapshot){
   console.log( snapshot.val() );
}); 

这给了我一个错误:

Query.once failed: Was called with 1 argument. Expects at least 2.  

即使我的Firebase版本是2.4.2。

JSBin:http://jsbin.com/yivelugage/1/edit?js,console

截图:
enter image description here

这里有什么问题? :)

0 个答案:

没有答案