0

I have a angular 2 SPA running from within a SharePoint 2010 document library. However, I have a problem with routing. When I start the application by running "index.html", the link in the browser shortly displays:

<server>/scripts/angular_app/index.html

When the application is loaded it changes to:

<server>/scripts/angular_app/#/information-system

'information-system' is the default route of my application. So far, so good. If I do a reload of the page now, SharePoint loads its default view:

<server>/scripts/angular_app/Forms/AllItems.aspx

This is because the routing removes the 'Index.html' from the url and SharePoint loads the default which is 'AllItems.aspx' and not 'index.html'.

Is there any way of telling the angular 2 routing system to leave the 'index.html' bit in the url?

Thanks for any help!

Joachim

2 Answers 2

1

I added following line to index.html to keep index.html in the URL all the time:

<base href="/index.html">
Sign up to request clarification or add additional context in comments.

Comments

0

I solved my issue by extending the base href with the filename at compile time:

ng build --dev --bh /scripts/filingangular/index.html

I was not aware that you could put an actual filename here.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.