Moving from ng1 to ng2, I would like to continue using anchor hash '#'
for routing.
afaik, ng2 uses default PathLocationStrategy wherein we define a <base-href="/">
which is the base path used by angular 2 router for client side routing, documented here.
Since I am using HashLocationStrategy, will there be any problems if I remove <base-href="">
from index.html? I have created a small app with following routes and it seems to be working fine.
export const ROUTES: Routes = [{
path: '', redirectTo: 'login', pathMatch: 'full'
}, {
path: 'app', component: AppComponent
}, {
path: 'login', component: LoginComponent
}, {
path: 'error', component: ErrorComponent
}
];
thanks,