I'm using the Router and RouteParams in Angular 2 Dart.
My routes are as follow:
@RouteConfig(const [
const Route(path: '/', component: ViewLanding, as: 'home'),
const Route(path: '/landing', component: ViewLanding, as: 'landing'),
const Route(path: '/flights', component: ViewFlights, as: 'flights'),
const Route(path: '/picker/:cityDepart/:cityArrival/:dateDepart/:dateArrival/', component: ViewFlights, as: 'picker'),
const Route(path: '/order/:id/:level/:dateDepart/:dateArrival/', component: ViewOrder, as: 'order'),
const Route(path: '/order/complete', component: ViewComplete, as: 'orderComplete')
])
// Application Entry Point:
void main() {
print('-- Main.dart 2 --');
bootstrap(Tickets, [
routerInjectables,
client_classes,
// The base path of your application
bind(APP_BASE_HREF).toValue('/'),
// uncomment this if you want to use '#' in your url
bind(LocationStrategy).toClass(HashLocationStrategy)
]);
}
This works fine with router-outlet / router-link / router.navigate
However, on page reload - I don't get a positive match for routes with params. IE: if I refresh http://localhost:8080/#/picker/SAN/SFO/2015-01-01/2015-04-02
- I go to a the parent view with no child routes. This symptom is true for any route with params.
Navigating directly to or refreshing to: http://localhost:8080/#/flights/
- works as expected - the ViewFlights component is instantiated
Symptoms: routing with params fails.
Question: How do I define route configurations to work with parameters on refresh
Links: https://github.com/rightisleft/web_apps_dart/blob/angular2/web/main.dart https://github.com/rightisleft/web_apps_dart/blob/angular2/lib/client/tickets.dart