function LoginController($scope, AuthService, $routeParams, $location) {

        $scope.error = null;

        $scope.login = function login() {
            if ($scope.user && $scope.pass) {
                AuthService.logIn($scope.user, $scope.pass, function (result) {
                    if (result) {
                        if ($routeParams.redirect) {
                            $location.path($routeParams.redirect);
                        } else {
                            $location.path('/');
                        }
                    } else {
                        $scope.error = 'Invalid credentials';
                    }
                });
            }
        };
    }
/**
     * @namespace LoginController
     * @desc Controller for the login view
     * @memberOf Views
     */
@namespace LoginController
@desc Controller for the login view
@memberOf Views
@namespace LoginController @desc Controller for the login view @memberOf Views
function LoginController($scope, AuthService, $routeParams, $location) {
        $scope.error = null;
        $scope.login = function login() {
            if ($scope.user && $scope.pass) {
                AuthService.logIn($scope.user, $scope.pass, function (result) {
                    if (result) {
                        if ($routeParams.redirect) {
                            $location.path($routeParams.redirect);
                        } else {
                            $location.path('/');
                        }
                    } else {
                        $scope.error = 'Invalid credentials';
                    }
                });
            }
        };
    }
function LoginController ( $scope , AuthService , $routeParams , $location ) { $scope . error = null ; $scope . login = function login ( ) { if ( $scope . user && $scope . pass ) { AuthService . logIn ( $scope . user , $scope . pass , function ( result ) { if ( result ) { if ( $routeParams . redirect ) { $location . path ( $routeParams . redirect ) ; } else { $location . path ( '/' ) ; } } else { $scope . error = 'Invalid credentials' ; } } ) ; } } ; }
@namespace LoginController
 @desc Controller for the login view
 @memberOf Views
@namespace LoginController @desc Controller for the login view @memberOf Views