Closed delaneyj closed 10 years ago
<!DOCTYPE html> <html> <head> <title>testRoutes</title> </head> <body> <p id="info"></p> <script type="application/dart"> import 'dart:html'; import 'package:route_hierarchical/client.dart'; var info = querySelector("#info") as ParagraphElement; var router = new Router(); main() { router.root ..addRoute(name: 'article', path: '/article/:articleId', enter: showArticle) ..addRoute(name: 'home', path: '/', enter: showHome, defaultRoute: true); router.listen(); } void showHome(RouteEvent e) { info.innerHtml = "In showHome<br>${router.url("article")}"; } void showArticle(RouteEvent e) { var articleId = e.parameters['articleId']; info.innerHtml = "In showArticle $articleId"; } </script> <script src="packages/browser/dart.js"></script> </body> </html>
Tried
#/article/1234 #article/1234 #/article #/article/ #/article/null #/article/1234/
all with no luck.
try:
var router = new Router(useFragment: true);
Great! The example should probably be updated or comments to explain why this is needed.
Tried
all with no luck.