Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49083

Ionic and firebase - login, signin & Facebook problems

$
0
0

@AntoninMarchard wrote:

Hi everyone !
I'm creating an app for my years end application in my school. I try to create an identification system with login, signup, and maybe a facebook connect. However, I had a big problem with firebase, the google chrome console display this message : 'ReferenceError: Firebase is not defined' .. I don't understand what happened, because in my section I add :

<script src="lib/firebase/firebase.js"></script>
<script src="lib/angularfire/dist/angularfire.js"></script>

But it doesn't work .. This is my script for my connexion system :

.controller('loginCtrl', function($scope, $state) {
    $scope.loginEmail = function(){
    var ref = new Firebase("https://WizzU.firebaseio.com");
    ref.authWithPassword({
      email    : $scope.data.email,
      password : $scope.data.password
    }, function(error, authData) {
      if (error) {
        console.log("Login Failed!", error);
      } else {
        console.log("Authenticated successfully with payload:", authData);
      }
    });

  };
})
// Inscription Controller
.controller('signinCtrl', function($scope) {
  $scope.signupEmail = function(){

  var ref = new Firebase("https://WizzU.firebaseio.com");

  ref.createUser({
    email    : $scope.data.email,
    password : $scope.data.password
  }, function(error, userData) {
    if (error) {
      console.log("Error creating user:", error);
    } else {
      console.log("Successfully created user account with uid:", userData.uid);
    }
  });
};
});`

Does anyone could help me ? :confused:
Thank !

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49083

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>