在均值堆栈 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
。
有谁知道怎么去https://localhost:3000/addin/home
一边保持office.js
和history.js
?
我找到了...只需使用
template: '<a href="addin/home" target="_self">one</a>'
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句