Firebase Reference not returned after add

老子叫甜甜 提交于 2019-12-12 02:39:27

问题


I do something like this:

 var temp = $scope.names.$add({"firstname" : $scope.firstname, "lastname" : $scope.lastname, "school" : $scope.selectedSchool});

I get a returned object, but when I try

$log.log(temp.toString()); 

I get just the object, whereas the documentation for firebase says I should see the path to the string of my new firebase URL. I also tried

$log.log(temp.name()); 

And same result, is this related to the implementation of those "functions" in angularfire, or to actual firebase itself?

I'm trying to syncronize adding "names" to a names portion of my json object, and then following it up with creating a section in my json object where I can get more details of the individual and so I want to match up the key's

kinda like this JSON Data structure resulting in the least passed data from database

I don't see how to get the above to work, and I saw (at one point, can't find the link now), that firebase was recommending using transaction not the "once" operation, so I was hoping I would get the individuals key, then pass that into creating a new firebase "subobject?" that matched it.

来源:https://stackoverflow.com/questions/20874252/firebase-reference-not-returned-after-add

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!