search

Home  >  Q&A  >  body text

Front-end - How to jump to the page in angualr Js?

I now have a login page. I want to go to the homepage after successful login.

    $http({
        method: 'GET',
        params: {
            'username': $scope.username
        },
        url: 'http://192.168.1.109:9090/userGet'
    }).success(function (data, status, headers, config) {
        if(null != data){
            $scope.error = "";
            //怎么跳到主页 , 用angular js 的方式而不是jquery或者javascript . 
        }
    }).error(function (data, status, headers, config) {
        if(null == data){
            $scope.error = "用户名或密码错误";
        }
    });

How to do it. ?

仅有的幸福仅有的幸福2855 days ago606

reply all(1)I'll reply

  • PHPz

    PHPz2017-05-15 17:01:03

    You can use $location
    $location.path('/index')

    reply
    0
  • Cancelreply