javascript - Working of Firebase.on() and $firebaseArrayVariable.$watch() -


i'm using angularfire 1.2.0 , firebase 2.2.4

i have 2 applications, 1 uploading data firebase, , other 1 used displaying data in realtime.

the application handles uploading of data firebase made in c# using firesharp library. firesharp uses rest api behind scene. uploads data , generate unique keys on firebase every child , node.

the second application used display data. made using angularfire, angularjs, , firebase. problem that, i'm confused how use events child_added can listen new records , update display application.

note: first application continuously uploads data every 4 5 seconds

below code not getting fired if application pushing data continuously.

  var dashobject = new firebase("https://url/datanode");         dashobject.on("child_added", function (newchild, previoussiblingchild) {             console.log("new child");             console.log(newchild);              }); 

and have tried code below. works , it's logging data console, shows keys of new child if child_added fired. want data of new child, not keys.

var testquery = dashobject.orderbychild("victim_incidentdate").startat('1446577577474').endat('14463222357474');      var vicdata = $firebasearray(testquery);     vicdata.$watch(function (event) { console.log(event)}); 

below code c# application uploads data , lists variable populated using entityframework 6.0. code populating lists variable not shown,i shows decalaration here inform people datatype. ifirebaseclient used intialize client

 using firesharp.interfaces;     using firesharp.config;     using firesharp;     using firesharp.response;     using firesharp.eventstreaming;     using firesharp.extensions;     using newtonsoft.json;  list<mycustomclassdatacontract> lists=null;     ifirebaseclient client = null;  for(int i=0;i<lists.length;i++) { pushresponse riskresponse = await client.pushasync("riskcatdetail", lists[i]); string riskid = riskresponse.result.name; 

}


Comments