离子和firebase连接系统

时间:2016-06-04 17:11:35

标签: javascript facebook ionic-framework firebase

我正在法国为我的学校创建一个应用程序,我的Ionic应用程序上有firebase问题。我尝试创建一个用户系统,登录,登录,注册和Facebook连接。

我不明白,我在标题部分添加了这个:

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

但它不起作用。这是我的剧本:

.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);
    }
  });
};
});

我在app.js的模块中添加了firebase:

angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'firebase'])

我有这样的信息:

ReferenceError: Firebase is not defined

有人可以帮助我吗?我完全输了! 谢谢!

0 个答案:

没有答案