Here is my project directory structure:
--root
--app
--app.ts
--boot.ts
--index.html
--node_modules
Here is my code:
boot.ts
bootstrap(AppComponent, [
ROUTER_PROVIDERS,
provide(LocationStrategy, {useClass: HashLocationStrategy})
]);
app.ts
@RouteConfig([
{path: '/', name: 'root', redirectTo: ['/pageA']},
{path: '/page-a', name: 'pageA', component: PageA},
{path: '/page-b', name: 'pageB', component: PageB}
])
html file:
<head>
<base href="/">
<script src="node_modules/angular2/bundles/router.dev.js"></script>
...
</head>
It works, but when I look at the console, it tell me "http://localhost:63342/#/page-a Failed to load resource: the server responded with a status of 404 (Not Found)"
In addition, when I refresh the page, it shows the "404 not found" page.