Hi Sander,

No this makes perfect sense. I had been starting at this code for too long 
so when I posted this last night I just walked away from it and needed a 
second eye. That is why paired programming works I guess lol

Here is my OLD logic that I had using jquery...

    $scope.login = function () {

        $http.post('../MINT/scripts/php/validate_user', $scope.loginData)
        .success(function(phpData) {
            console.log("We have came back");
            if (phpData === 'Success')
                $location.path('/account');
            else {
                $scope.errors.splice(0, $scope.errors.length);
                $scope.displayErrors = 1;
                for (var i = 0; i < phpData.length; i++)
                    $scope.errors.push(phpData[i]);
            }

            return false;
        });

        return false;
    };

you can see I had it wrapped inside of a function. When I went to convert 
it I just forgot it and your eyes caught it THANK YOU as well as Luke up top

On Friday, April 4, 2014 1:00:59 AM UTC-4, Sander Elias wrote:
>
> Hi Billy,
>
> the way you set up your login function makes sure the request fires 
> directly!
> change it to this:
>
>
>       $scope.login = function() {
>          AuthFactory.authenticate($scope.loginData).then(function(response) {
>                console.log(response.status);
>                console.log(response.data);
>             }
>          );
>       };
>
> That will probably explain your question faster then I can by using words 
> :)
> If you don't get why this works, and your sample not, just ask, and I will 
> try to clarify it a bit more!
>
> Regards
> Sander
>

-- 
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.

Reply via email to