Syncing Data With Firebase Using Ionic Framework

$scope.list = function() {
    fbAuth = fb.getAuth();
    if(fbAuth) {
        var sync = $firebase(fb.child("users/" + fbAuth.uid));
        var syncObject = sync.$asObject();
        syncObject.$bindTo($scope, "data");
    }
}

Once syncObject is bound to $scope.data, which is provided by AngularFire, data will be synchronized consistently in three ways (UI, $scope.data, and Firebase): Calling $scope.data.todos.push({title: result}); will update the UI and also sync it to Firebase; no further code adjustments are required.

Syncing Data With Firebase Using Ionic Framework →

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.