Hello to everyone reading this! I have a problem executing function in my Ctrl.
I tried to do some alerts, console.log and search here for answer but didn't find exect same problem, just similar. I'll be grateful to everyone helping me solve this problem)
HTML
// ctrls.js
var gameApp = angular.module('gameApp');
var AuthorizationCtrl = gameApp.controller('AuthorizationCtrl', function($scope) {
$scope.email = email.value;
$scope.password = password.value;
$scope.signUp = function() { // this function isn't executed when I hope it to be
console.log($scope.email, $scope.password);
gameFactory.signUp(email, password).then(function() {
});
};
});
// services.js
function Factory(FBMSG, $firebaseArray, $firebaseAuth) {
var events = {},
ref = new Firebase(FBMSG),
games = $firebaseArray(ref),
auth = $firebaseAuth(ref);
events.getAllGames = function() {
return games.$loaded();
};
events.signUp = function(email, password) {
return auth.createUser({
email: email,
password: password
});
};
return events;
}
<script src="http://ift.tt/1mQ03rn"></script>
<!-- ng-view -->
<div ng-controller="AuthorizationCtrl" style="background-color: rgba(0, 0, 0, .5); width: 40%; margin:auto">
<form>
<div class="form-group">
<label for="email">Email address</label>
<input ng-model='email' type="email" class="form-control" id="email" placeholder="Email" required>
</div>
<div class="form-group">
<label for="password">Password</label>
<input ng-model="password" type="password" class="form-control" id="password" placeholder="Password" required>
</div>
<a href="">Forgot your password?</a>
<div>
<button ng-click="SignUp()">SignUp</button> <!-- Problem!!! -->
</div>
</form>
</div>
Aucun commentaire:
Enregistrer un commentaire