-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Description
It appears that only the HashLocationStrategy updates the url on calls to router.navigate. When I change my LocationStrategy to the HTML5LocationStrategy the urls no longer update when navigating from "/products/:productId" -> "/". The navigation does occur, though.
This is happening on Alpha.31.
The code I'm using is below.
Component Controller code
updateProduct(product: {productId:string, name:string, description:string}) {
this.productStore.updateProduct(product);
this.router.navigate('/');
}Routes
@RouteConfig([
{path: '/', component: ProductsList, as: 'Products'},
{path: '/products/:productId', component: UpdateProducts, as: 'UpdateProducts'}
])Bootstrap
import { httpInjectables } from 'angular2/http';
import { bootstrap, bind } from 'angular2/angular2';
import { routerInjectables, LocationStrategy, HashLocationStrategy, HTML5LocationStrategy } from 'angular2/router';
import { Onboarding } from './components/onboarding/onboarding';
bootstrap(Onboarding, [
httpInjectables,routerInjectables, bind(LocationStrategy).toClass(HTML5LocationStrategy )
]);Reactions are currently unavailable