AngularJS重定向$ location.path(' examp.html')

时间:2017-08-15 10:55:48

标签: javascript angularjs redirect

我正在使用重定向函数,当我调用该函数时,主域路径的信息是/#!/ http://domain.de/backend/#!/splitscreen.html

var app = angular.module('loginApp', []);
app.controller('loginCtrl', function($scope, $location) {
$scope.email = "exampel@adress.de";
$scope.password = "password";

        $scope.login = function () {
            $location.path();
            if($scope.email === "exampel@adress.de" || $scope.password === "pw"){
                console.log($location.path('splitscreen.html'))
                $location.path('splitscreen.html');
            }else{
                $scope.alertMsg = "Wrong Email or Password"

            }

        };

});

0 个答案:

没有答案