In my Excel Angular Web Add-In I get the following error, when navigating to new routes:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'index.html'
However, the routes still work. How can I fix this?
In my Excel Angular Web Add-In I get the following error, when navigating to new routes:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'index.html'
However, the routes still work. How can I fix this?
For some reason, when Office.js is included, Angular 2+ appends a # to the route. For example, the default url path for my add-in was http://localhost:3000/#/.
Therefore, I had to update my routing module to use a hash:
RouterModule.forRoot(appRoutes, { useHash: true })
instead of:
RouterModule.forRoot(appRoutes)