【发布时间】:2017-12-12 14:03:43
【问题描述】:
在平均堆栈 Web 应用程序中,我使用 html5mode 并在 index.html 中有以下代码:
<base href="/" />
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script>
<script src="https://cdn.rawgit.com/devote/HTML5-History-API/master/history.js"></script>
我已经定义了以下 angular-ui-router:
.state('addinHome', {
url: '/addin/home',
template: "home page"
})
.state('addinTest', {
url: '/addin/test',
template: '<a href="addin/home">one</a>',
controller: 'TestCtrl'
})
然后,我转到https://localhost:3000/addin/test,点击one 会转到https://localhost:3000/addin/test#%2Faddin%2Fhome,而我想转到https://localhost:3000/addin/home。
如果我没有office.js 和history.js,点击one 会引导我到https://localhost:3000/addin/home。
有谁知道如何在保持office.js 和history.js 的同时转到https://localhost:3000/addin/home?
【问题讨论】:
标签: javascript angularjs angular-ui-router html5-history html5mode