Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit f149eef

Browse files
committed
update chapter 6 to use new routing features
1 parent ac7a1c4 commit f149eef

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

Chapter_06/web/view/addRecipe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div ng-bind-route="add">
1+
<div>
22
<h3>Add recipe</h3>
33
Now it's your turn. Write some code to add a new recipe
44
</div>

Chapter_06/web/view/editRecipe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div ng-bind-route="recipe">
1+
<div>
22
<h3>Edit recipe</h3>
33
Now it's your turn. Write some code to edit the recipe
44
</div>

Chapter_06/web/view/viewRecipe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div ng-bind-route="recipe">
1+
<div>
22
<view-recipe recipe-map="ctrl.recipeMap">
33
</view-recipe>
44
</div>

Chapter_06/web/view/view_recipe_component.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ part of recipe_book;
1010
}
1111
)
1212
class ViewRecipeComponent {
13-
Route _route;
1413
Map<String, Recipe> recipeMap;
15-
Recipe _recipe;
14+
String _recipeId;
1615

1716
get recipe {
18-
return recipeMap[_route.parameters['recipeId']];
17+
return recipeMap[_recipeId];
1918
}
2019

2120
ViewRecipeComponent(RouteProvider routeProvider) {
22-
_route = routeProvider.route;
21+
_recipeId = routeProvider.parameters['recipeId'];
2322
}
24-
}
23+
}

0 commit comments

Comments
 (0)