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/angular/lib/routing/module.dart

Issue 180873006: Update the Angular/DI tests to latest from github. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review feedback Created 6 years, 10 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/angular/lib/routing/module.dart
diff --git a/third_party/pkg/angular/lib/routing/module.dart b/third_party/pkg/angular/lib/routing/module.dart
index e32c9682ace503ed2081fec7b7d877693f49c44d..23a2e3a4ddfb846f01223218900e90a77663d980 100644
--- a/third_party/pkg/angular/lib/routing/module.dart
+++ b/third_party/pkg/angular/lib/routing/module.dart
@@ -1,10 +1,11 @@
/**
- * The [routing] library makes it easier to build large single-page applications. The
- * library lets you map the browser address bar to semantic structure of your
- * application and keeps them in sync.
+ * The [routing] library makes it easier to build large single-page
+ * applications. The library lets you map the browser address bar to semantic
+ * structure of your application and keeps them in sync.
*
- * Angular uses the [route_hierarchical] package to define application routes and
- * to provide custom tools to make it easier to use routing with Angular templates.
+ * Angular uses the [route_hierarchical] package to define application routes
+ * and to provide custom tools to make it easier to use routing with Angular
+ * templates.
*
* Lets consider a simple recipe book application. The application might have
* the following pages:
@@ -23,39 +24,35 @@
*
*
* Lets try to define those routes in Angular. To get started we need to
- * provide an implementation of [RouteInitializer] interface.
+ * provide an implementation of [RouteInitializerFn] function.
*
- * class RecipesRouteInitializer implements RouteInitializer {
- * void init(Router router, ViewFactory view) {
- * // define routes here.
- * }
- * }
+ * void initRoutes(Router router, ViewFactory view) {
+ * // define routes here.
+ * }
*
* var module = new Module()
- * ..type(RouteInitializer, implementedBy: RecipesRouteInitializer);
+ * ..factory(RouteInitializerFn, (_) => initRoutes);
*
* Lets see how we could define our routes using the routing framework:
*
- * class RecipesRouteInitializer implements RouteInitializer {
- * void init(Router router, ViewFactory view) {
- * router
- * ..addRoute(
- * name: 'recipes',
- * path: '/recipes',
- * enter: view('recipes.html'))
- * ..addRoute(
- * name: 'addRecipe',
- * path: '/addRecipe',
- * enter: view('addRecipe.html'))
- * ..addRoute(
- * name: 'viewRecipe',
- * path: '/recipe/:recipeId/view',
- * enter: view('viewRecipe.html'))
- * ..addRoute(
- * name: 'editRecipe',
- * path: '/recipe/:recipeId/edit',
- * enter: view('editRecipe.html'));
- * }
+ * void initRoutes(Router router, ViewFactory view) {
+ * router
+ * ..addRoute(
+ * name: 'recipes',
+ * path: '/recipes',
+ * enter: view('recipes.html'))
+ * ..addRoute(
+ * name: 'addRecipe',
+ * path: '/addRecipe',
+ * enter: view('addRecipe.html'))
+ * ..addRoute(
+ * name: 'viewRecipe',
+ * path: '/recipe/:recipeId/view',
+ * enter: view('viewRecipe.html'))
+ * ..addRoute(
+ * name: 'editRecipe',
+ * path: '/recipe/:recipeId/edit',
+ * enter: view('editRecipe.html'));
* }
*
* We defined 4 routes and for each route we set views (templates) to be
@@ -124,31 +121,30 @@
* The routing framework allows us to define trees of routes. In our recipes
* example we could have defined our routes like this:
*
- * class RecipesRouteInitializer implements RouteInitializer {
- * void init(Router router, ViewFactory view) {
- * router
- * ..addRoute(
- * name: 'recipes',
- * path: '/recipes',
- * enter: view('recipes.html'))
- * ..addRoute(
- * name: 'addRecipe',
- * path: '/addRecipe',
- * enter: view('addRecipe.html'))
- * ..addRoute(
- * name: 'recipe',
- * path: '/recipe/:recipeId',
- * mount: (Route route) => route
- * ..addRoute(
- * name: 'view',
- * path: '/view',
- * enter: view('viewRecipe.html'))
- * ..addRoute(
- * name: 'edit',
- * path: '/edit',
- * enter: view('editRecipe.html')));
- * }
+ * void initRoutes(Router router, ViewFactory view) {
+ * router
+ * ..addRoute(
+ * name: 'recipes',
+ * path: '/recipes',
+ * enter: view('recipes.html'))
+ * ..addRoute(
+ * name: 'addRecipe',
+ * path: '/addRecipe',
+ * enter: view('addRecipe.html'))
+ * ..addRoute(
+ * name: 'recipe',
+ * path: '/recipe/:recipeId',
+ * mount: (Route route) => route
+ * ..addRoute(
+ * name: 'view',
+ * path: '/view',
+ * enter: view('viewRecipe.html'))
+ * ..addRoute(
+ * name: 'edit',
+ * path: '/edit',
+ * enter: view('editRecipe.html')));
* }
+ * }
*/
library angular.routing;
@@ -175,6 +171,7 @@ class NgRoutingModule extends Module {
type(NgRoutingHelper);
value(RouteProvider, null);
value(RouteInitializer, null);
+ value(RouteInitializerFn, null);
// directives
value(NgViewDirective, null);
« no previous file with comments | « third_party/pkg/angular/lib/playback/playback_http.dart ('k') | third_party/pkg/angular/lib/routing/ng_bind_route.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698