有人懂 angular 的路由规则吗

2016-01-27 12:02:57 +08:00
 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('/');
});

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

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

https://www.v2ex.com/t/253676

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

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

© 2021 V2EX