I am going through the tutorials for Angular 2 and have been able to get a simple application up and running. Now, I am moving on to the routing and navigation part found h
For this issue, you need to use PathLocationStrategy or HashLocationStrategy for your application. It's available in the 'angular2/router'.
Example for using HashLocationStrategy:
boot.ts
bootstrap(AppCmp, [
ROUTER_PROVIDERS,
provide(LocationStrategy, {useClass: HashLocationStrategy})
]);
and in your main component,
class AppCmp {
constructor(location: Location) {
location.go(location.path());
}
The location.path() dynamically gives the path for the page to be loaded.