Advertisement
Guest User

FB Rules Controller

a guest
Dec 11th, 2017
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $scope.get_user_locations = function () {
  2.  
  3.         firebase.auth().onAuthStateChanged(function (user) {
  4.             if (user) {
  5.  
  6.                 var returned_locations = firebase.database().ref('user_locations/');
  7.                 returned_locations.on('value', function (snapshot) {
  8.                     $scope.user_locations = snapshot.val();
  9.                 });
  10.  
  11.  
  12.             } else {
  13.                 $state.go('login');
  14.             }
  15.         });
  16.  
  17.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement