angualr Js 如何跳转页面 ?

我现在有个登陆页面, 我想在登陆成功后转到主页去 . 

    $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 = "用户名或密码错误";
        }
    });

该怎么弄 . ?

阅读 3.2k
1 个回答

可以使用$location
$location.path('/index')

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题