Open calebeaires opened 7 years ago
I haven't tested it. Does it not work with Firebase?
I haven't been able to get this to work but maybe I'm doing it wrong. This is what I got so far,
var ref = firebase.database().ref("GetSummaryData");
$scope.accounts = $sessionStorage.$default($firebaseArray(ref));
console.log($sessionStorage.$default().summary);
but what comes out though is a empty object. Results should just be a array. I believe its because the promise hasn't been resolved before the sessionStorage call?
Figured it out
ref.on("value", function(snapshot) {
$scope.accounts = snapshot.val();
$sessionStorage.$default($scope.accounts);
console.log($sessionStorage.$default());
}, function(errorObject) {
console.log("The read failed: " + errorObject.code);
});
Would be cool if this module could work with Firebase on something like "three way data binding". Has someone done some work like that.
AngularFire has an bindTo component, maybe this could be the start point.