S
S
someserj2016-08-03 19:51:46
JavaScript
someserj, 2016-08-03 19:51:46

What is the problem with new Firebase 3.xx and AngularJS?

I wrote a service, I used Firebase 2, updated to the new Firebase and now the code does not work. in the console on the line it var ref = new Firebase(FIREBASE_URL);says Firebase is not defined
I understand that everything has changed in the new version, tell me how now to rewrite this service for the new version?

function fitfire($log, FIREBASE_URL, $firebaseObject, $firebaseArray){
    var vm = this;

    var ref = new Firebase(FIREBASE_URL);
    var refObj = $firebaseObject(ref);
    var refArr = $firebaseArray(ref);

    var usersRef = ref.child('users');
    var usersArr = $firebaseArray(usersRef);

    vm.getUsers = function(cb){
      return usersArr.$loaded(cb);
    }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question