HTML5-History-API icon indicating copy to clipboard operation
HTML5-History-API copied to clipboard

Routing does not work well with HTM5-History-API

Open chengtie opened this issue 8 years ago • 1 comments

Hello,

In a mean-stack web application, I use html5mode and have the following code in 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>

I have defined the following 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'
})

Then, I go to https://localhost:3000/addin/test, clicking on one leads me to https://localhost:3000/addin/test#%2Faddin%2Fhome, whereas I would want to go to https://localhost:3000/addin/home.

If I don't have office.js and history.js, clicking on one does lead me to https://localhost:3000/addin/home.

Does anyone know how to go to https://localhost:3000/addin/home while keeping office.js and history.js?

Cheers

chengtie avatar Jul 08 '17 10:07 chengtie

I am also having this problem, did you figure out how to fix it? Or maybe other library??

Itisfilipe avatar Oct 04 '17 01:10 Itisfilipe