I have a routing scheme where #/articles leads to the articles.html view, and #/articles/featured leads to featured.html. I'm not sure how to declare this nested writing, though. If I configure my routes as follows, both #/articles and #/articles/featured leads to articles.html (since both paths match r'^articles').
library my_router;
import 'package:angular/angular.dart';
class MyRouteInitializer implements RouteInitializer {
init(Router router, ViewFactory view) {
router.root
..addRoute(
name: 'articles',
path: '/articles',
enter: view('views/articles.html'),
mount: (Route route) => route
..addRoute(
name: 'featured',
path: '/featured',
enter: view('views/featured.html'))
);
}
}
If I omit the enter: view('views/articles.html') line, the #/articles/featured route correctly routes to featured.html, but then nothing routes to articles.html.