前端 - angualr Js 如何跳转页面 ?

浏览:37日期:2023-01-19

问题描述

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

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

该怎么弄 . ?

问题解答

回答1:

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

相关文章: