Html 角度js重定向到视图

Html 角度js重定向到视图,html,angularjs,angularjs-scope,Html,Angularjs,Angularjs Scope,我有下面的代码 使用$route服务调用defaultview函数时呈现/结果内容的代码 angular.module('myapp').controller ('ResultController',['$route',function ($route){ this.defaultview=function(){$routes._ _ _ _ ('/result');};} 最后一行破折号区域的值是多少?有什么建议吗?如果您使用的是ngRouter,则需要使用$location。i、

我有下面的代码

使用$route服务调用defaultview函数时呈现/结果内容的代码

angular.module('myapp').controller
    ('ResultController',['$route',function ($route){ this.defaultview=function(){$routes._ _ _ _  ('/result');};}

最后一行破折号区域的值是多少?有什么建议吗?

如果您使用的是ngRouter,则需要使用$location。i、 e

在您的情况下,您可以使用

$location.path('/result');

如果您使用的是ngRouter,则需要使用$location。i、 e

在您的情况下,您可以使用

$location.path('/result');

我认为这对您很有用,可能是$location.path('/result')OP,您使用的是angular ui路由器吗?如果没有,请删除标记。我认为这对您有用,可能是$location.path('/result')OP,您使用的是angular ui路由器吗?如果没有,请移除标签