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

Commit c8c19fb

Browse files
committed
change controllers to use NgController
1 parent c440144 commit c8c19fb

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

Chapter_02/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ <h3>Recipe List</h3>
1111
<ul>
1212
<li class="pointer"
1313
ng-repeat="recipe in ctrl.recipes"
14-
ng-click="ctrl.selectRecipe(recipe)">{{recipe.name}}</li>
14+
ng-click="ctrl.selectRecipe(recipe)">
15+
{{recipe.name}}
16+
</li>
1517
</ul>
1618

1719
<h3>Recipe Details</h3>

Chapter_02/main.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import 'package:perf_api/perf_api.dart';
1515
* The directive's public fields are available for data binding from the view.
1616
* Similarly, the directive's public methods can be invoked from the view.
1717
*/
18-
@NgDirective(
18+
@NgController(
1919
selector: '[recipe-book]',
2020
publishAs: 'ctrl')
2121
class RecipeBookController {
2222

23-
List recipes;
23+
List<Recipe> recipes;
2424
RecipeBookController() {
2525
recipes = _loadData();
2626
}
@@ -54,7 +54,7 @@ class RecipeBookController {
5454
new Recipe('My So-So Dessert','Desserts',
5555
["Ingredient 1", "Ingredient 2"],
5656
"Some Directions", 3),
57-
];
57+
];
5858
}
5959
}
6060

Chapter_03/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'package:perf_api/perf_api.dart';
66

77
part 'rating_component.dart';
88

9-
@NgDirective(
9+
@NgController(
1010
selector: '[recipe-book]',
1111
publishAs: 'ctrl')
1212
class RecipeBookController {
@@ -46,7 +46,7 @@ class RecipeBookController {
4646
new Recipe('My So-So Dessert','Desserts',
4747
["Ingredient 1", "Ingredient 2"],
4848
"Some Directions", 3),
49-
];
49+
];
5050
}
5151
}
5252

Chapter_04/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class CategoryFilter {
2323
}
2424
}
2525

26-
@NgDirective(
26+
@NgController(
2727
selector: '[recipe-book]',
2828
publishAs: 'ctrl')
2929
class RecipeBookController {

Chapter_05/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ part 'recipe_book_router.dart';
1515
part 'view/view_recipe_component.dart';
1616
part 'view/search_recipe_component.dart';
1717

18-
@NgDirective(
18+
@NgController(
1919
selector: '[recipe-book]',
2020
publishAs: 'ctrl')
2121
class RecipeBookController {

0 commit comments

Comments
 (0)