Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/pkg/route_hierarchical/example/full/index.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/pkg/route_hierarchical/example/full/index.dart
diff --git a/third_party/pkg/route_hierarchical/example/full/index.dart b/third_party/pkg/route_hierarchical/example/full/index.dart
new file mode 100644
index 0000000000000000000000000000000000000000..89558028913c225b33f3fa0a0320711ce749efa7
--- /dev/null
+++ b/third_party/pkg/route_hierarchical/example/full/index.dart
@@ -0,0 +1,64 @@
+import 'package:logging/logging.dart';
+import 'package:route_hierarchical/client.dart';
+
+Router router;
+String homeLink;
+String portfolioLink;
+
+void main() {
+ new Logger('')
+ ..level = Level.FINEST
+ ..onRecord.listen((r) =>
+ print('${new DateTime.now()}: [${r.level}] ${r.message}'));
+
+ router = new Router(useFragment: true);
+ router.root
+ ..addRoute(
+ name: 'home',
+ defaultRoute: true,
+ path: '/home')
+ ..addRoute(
+ name: 'companyInfo',
+ path: '/companyInfo',
+ mount: (child) => child
+ ..addRoute(
+ name: 'companyId',
+ path: '/:companyId',
+ mount: new _CompanyInfoRoutable())
+ ..addRoute(
+ name: 'invalid',
+ path: '/invalid',
+ defaultRoute: true))
+ ..addRoute(
+ name: 'portfolio',
+ path: '/portfolio',
+ mount: (Route child) => child
+ ..addRoute(
+ name: 'list',
+ path: '/list',
+ defaultRoute: true)
+ ..addRoute(
+ name: 'company',
+ path: '/:tabId',
+ mount: new _CompanyInfoRoutable()));
+ router.listen();
+
+ homeLink = router.url('home');
+ portfolioLink = router.url('portfolio');
+}
+
+class _CompanyInfoRoutable implements Routable {
+ void configureRoute(Route route) {
+ route
+ ..addRoute(
+ name: 'info',
+ defaultRoute: true,
+ path: '/info')
+ ..addRoute(
+ name: 'activities',
+ path: '/activities')
+ ..addRoute(
+ name: 'notes',
+ path: '/notes');
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698