有人懂 angular 的路由规则吗

2016 年 1 月 27 日
 lyseky

怎么默认访问主页的时候不要显示这段,如:http://localhost:63342/mulan-angular/client/src/

//设置路由
myApp.config(function ($stateProvider,$urlRouterProvider,$locationProvider) {
//去掉路由中的[#]
$locationProvider.html5Mode({
enabled: true,
requireBase: false});
$stateProvider
.state('home',{
url:"/",
templateUrl:"mulan-angular/client/src/index.html",
});
// $urlRouterProvider.otherwise('/');
});

3503 次点击
所在节点    Angular
6 条回复
clijiac
2016 年 1 月 27 日
你这个用的是 ui-router 吧 ,没用过
看看这个 http://bubkoo.com/2014/01/02/angular/ui-router/guide/url-routing/
lyseky
2016 年 1 月 27 日
@clijiac 我想访问端口就直接是项目主页了,怎么设置
aivier
2016 年 1 月 27 日
这是 WebStorm 的调试地址,那上面的是你自己的项目文件夹路径吧,去不掉,你换个 Nginx 应该就没有了
bdbai
2016 年 1 月 27 日
同楼上, router 换的是路径后面的部分,前面归服务器管。
lyseky
2016 年 1 月 27 日
@aivier 人才,居然知道我用的 ide
lyseky
2016 年 1 月 27 日
@bdbai 3q

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://v2ex.xtra.eu.org/t/253676

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX