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

Chap 6 made consistent with previous chap; and follow Dart Style Guide #75

Merged
merged 1 commit into from
Feb 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chapter_03/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ <h3>Recipe List</h3>
</li>
</ul>

<h3>Recipe Details</h3>
<div ng-if="ctrl.selectedRecipe != null">
<h3>Recipe Details</h3>
<div><strong>Name: </strong>{{ctrl.selectedRecipe.name}}</div>
<div><strong>Category: </strong>{{ctrl.selectedRecipe.category}}</div>
<div><strong>Rating: </strong>
Expand Down
2 changes: 1 addition & 1 deletion Chapter_04/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ <h3>Recipe List</h3>
</li>
</ul>

<h3>Recipe Details</h3>
<div ng-if="ctrl.selectedRecipe != null">
<h3>Recipe Details</h3>
<div><strong>Name: </strong>{{ctrl.selectedRecipe.name}}</div>
<div><strong>Category: </strong>{{ctrl.selectedRecipe.category}}</div>
<div><strong>Rating: </strong>
Expand Down
2 changes: 1 addition & 1 deletion Chapter_05/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="style.css">
</head>
<body ng-cloak>

<div recipe-book>
<div ng-if="!ctrl.recipesLoaded || !ctrl.categoriesLoaded">
{{ctrl.message}}
Expand Down
1 change: 0 additions & 1 deletion Chapter_05/web/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,3 @@ class MyAppModule extends Module {
main() {
ngBootstrap(module: new MyAppModule());
}

4 changes: 2 additions & 2 deletions Chapter_06/lib/component/search_recipe_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class SearchRecipeComponent {
String nameFilterString = "";

@NgTwoWay('category-filter-map')
Map categoryFilterMap;
Map<String, bool> categoryFilterMap;

get categories {
List<String> get categories {
return categoryFilterMap.keys.toList();
}

Expand Down
2 changes: 1 addition & 1 deletion Chapter_06/lib/component/view_recipe_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ViewRecipeComponent {

String _recipeId;

get recipe {
Recipe get recipe {
return recipeMap[_recipeId];
}

Expand Down
2 changes: 1 addition & 1 deletion Chapter_06/lib/component/view_recipe_component.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div>
<div id="recipe-details">
<h3>Recipe Details</h3>
<div ng-if="ctrl.recipe != null">
<a class="extra-space" href="#/recipe/{{ctrl.recipe.id}}/edit">
Expand Down
8 changes: 4 additions & 4 deletions Chapter_06/lib/recipe_book.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ kitchen and took the recipe book with him!""";
bool categoriesLoaded = false;

// Data objects that are loaded from the server side via json
List _categories = [];
get categories => _categories;
List<String> _categories = [];
List<String> get categories => _categories;
Map<String, Recipe> _recipeMap = {};
get recipeMap => _recipeMap;
get allRecipes => _recipeMap.values.toList();
Map<String, Recipe> get recipeMap => _recipeMap;
List<Recipe> get allRecipes => _recipeMap.values.toList();

// Filter box
Map<String, bool> categoryFilterMap = {};
Expand Down
8 changes: 2 additions & 6 deletions Chapter_06/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@
<body ng-cloak>

<div recipe-book>

<header id="header">
<h2>Angular is fun! Here's a recipe book to prove it!</h2>
</header>

<div ng-if="!ctrl.recipesLoaded || !ctrl.categoriesLoaded">
{{ctrl.message}}
</div>

<div ng-if="ctrl.recipesLoaded && ctrl.categoriesLoaded">
<h3>Recipe List</h3>

<nav id="controls">
<search-recipe
name-filter-string="ctrl.nameFilter"
Expand Down