I'm on this part of the
tutorial:
https://thinkster.io/angulartutorial/learn-to-build-realtime-webapps/#creating-the-user-service-8
I am able to implement the Firebase fine, but the problems comes when I go
back to the "register" page. How it is supposed to work: "User Registers"
-> "Auto Login"
For some reason it is not automatically loggin in. The $scope.user.email is
not getting passed properly for some reason.
Any hints?
register.html -
<form ng-submit="register()">
<p ng-show="error" class="text-danger">{{ error }}</p>
<input type="email" ng-model="user.email" placeholder="Email"
class="form-control"><br>
<input type="text" ng-model="user.username" placeholder="Username"
class="form-control"><br>
<input type="password" ng-model="user.password" placeholder="Password"
class="form-control"><br>
<input type="submit" value="Register" class="btn btn-primary" />
</form>
register() -> auth.js -> factory -> dependency $rootscope included, and
$firebaseSimpleLogin
register: function (user)
{
return auth.$createUser(user.email, user.password);
}
....
return Auth;
controller -> auth.js -> Function($scope, $location, Auth, User)
$scope.register = function()
{
Auth.register($scope.user).then(
function(authUser)
{
User.create(authUser, $scope.user.username);
$location.path('/');
},
function (error)
{
$scope.error = error.toString();
}
);
};
User factory works fine injecting username into Firebase DB.
If you need to see more code holler, as I'm new at this.
Thanks,
Alex
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.