【发布时间】:2015-08-06 23:48:48
【问题描述】:
我正在使用带有这个 stateProvider 的 angularjs ui-router:
.state("admin", {
abstract:true,
url: "/admin",
templateUrl: "/app/template/adminabstract.html",
controller: "AdminAbstractController"
})
.state("admin.view1", {
url: "/view1",
templateUrl: "/app/template/adminview1.html",
controller: "AdminView1Controller"
}).state("admin.view2", {
url: "/view2",
templateUrl: "/app/template/adminview2.html",
controller: "AdminView2Controller"
})
这是当前的本地主机链接:
http://localhost:52058/index.html#/admin/view2
它在 localhost 中工作得很好,但是当我发布到服务器时它不再工作。服务器上的链接如下所示:
http://specific.com/appname/otheridentifier/index.html#/admin/view2
为了让我的应用在发布时能够正常工作,我认为我需要更改我的 ui-router 配置或状态提供程序,以便我的本地主机是
http://localhost:52058/index.html#/appname/otheridentifier/admin/view2
我在正确的轨道上吗?我需要做什么才能完成这项工作?
【问题讨论】:
-
是您的网站在“specific.org”的根目录或子目录中
-
它在一个子目录中:
标签: angularjs angular-ui-router