gpt4 book ai didi

angularjs - 如何设置 AngularJS 路由器的根位置?

转载 作者:行者123 更新时间:2023-12-03 06:51:58 25 4
gpt4 key购买 nike

我想从 http://mysite.com/hello/world 开始导航,而不是从网站根目录开始。

例如

$routeProvider
.when('/myurl', {
templateUrl: 'mytmpl.html',
controller: 'MyCtrl'
});

当我的网址为 http://mysite.com/hello/world/myurl

时应该使用react

我怎样才能做到这一点?

最佳答案

将基本标记添加到用户导航到 http://example.com/hello/world 时提供的主 HTML 文件:

<base href="/hello/world/" />

更多信息请访问 Developer Guide / Using $location

关于angularjs - 如何设置 AngularJS 路由器的根位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17319715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com