This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +13
-18
lines changed Expand file tree Collapse file tree 9 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ <h3>Recipe List</h3>
17
17
</ li >
18
18
</ ul >
19
19
20
- < h3 > Recipe Details</ h3 >
21
20
< div ng-if ="ctrl.selectedRecipe != null ">
21
+ < h3 > Recipe Details</ h3 >
22
22
< div > < strong > Name: </ strong > {{ctrl.selectedRecipe.name}}</ div >
23
23
< div > < strong > Category: </ strong > {{ctrl.selectedRecipe.category}}</ div >
24
24
< div > < strong > Rating: </ strong >
Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ <h3>Recipe List</h3>
19
19
</ li >
20
20
</ ul >
21
21
22
- < h3 > Recipe Details</ h3 >
23
22
< div ng-if ="ctrl.selectedRecipe != null ">
23
+ < h3 > Recipe Details</ h3 >
24
24
< div > < strong > Name: </ strong > {{ctrl.selectedRecipe.name}}</ div >
25
25
< div > < strong > Category: </ strong > {{ctrl.selectedRecipe.category}}</ div >
26
26
< div > < strong > Rating: </ strong >
Original file line number Diff line number Diff line change 5
5
< link rel ="stylesheet " href ="style.css ">
6
6
</ head >
7
7
< body ng-cloak >
8
-
8
+
9
9
< div recipe-book >
10
10
< div ng-if ="!ctrl.recipesLoaded || !ctrl.categoriesLoaded ">
11
11
{{ctrl.message}}
Original file line number Diff line number Diff line change @@ -28,4 +28,3 @@ class MyAppModule extends Module {
28
28
main () {
29
29
ngBootstrap (module: new MyAppModule ());
30
30
}
31
-
Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ class SearchRecipeComponent {
12
12
String nameFilterString = "" ;
13
13
14
14
@NgTwoWay ('category-filter-map' )
15
- Map categoryFilterMap;
15
+ Map < String , bool > categoryFilterMap;
16
16
17
- get categories {
17
+ List < String > get categories {
18
18
return categoryFilterMap.keys.toList ();
19
19
}
20
20
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class ViewRecipeComponent {
15
15
16
16
String _recipeId;
17
17
18
- get recipe {
18
+ Recipe get recipe {
19
19
return recipeMap[_recipeId];
20
20
}
21
21
Original file line number Diff line number Diff line change 1
- < div >
1
+ < div id =" recipe-details " >
2
2
< h3 > Recipe Details</ h3 >
3
3
< div ng-if ="ctrl.recipe != null ">
4
4
< a class ="extra-space " href ="#/recipe/{{ctrl.recipe.id}}/edit ">
Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ kitchen and took the recipe book with him!""";
25
25
bool categoriesLoaded = false ;
26
26
27
27
// Data objects that are loaded from the server side via json
28
- List _categories = [];
29
- get categories => _categories;
28
+ List < String > _categories = [];
29
+ List < String > get categories => _categories;
30
30
Map <String , Recipe > _recipeMap = {};
31
- get recipeMap => _recipeMap;
32
- get allRecipes => _recipeMap.values.toList ();
31
+ Map < String , Recipe > get recipeMap => _recipeMap;
32
+ List < Recipe > get allRecipes => _recipeMap.values.toList ();
33
33
34
34
// Filter box
35
35
Map <String , bool > categoryFilterMap = {};
Original file line number Diff line number Diff line change 7
7
< body ng-cloak >
8
8
9
9
< div recipe-book >
10
-
11
- < header id ="header ">
12
- < h2 > Angular is fun! Here's a recipe book to prove it!</ h2 >
13
- </ header >
14
-
15
10
< div ng-if ="!ctrl.recipesLoaded || !ctrl.categoriesLoaded ">
16
11
{{ctrl.message}}
17
12
</ div >
18
-
19
13
< div ng-if ="ctrl.recipesLoaded && ctrl.categoriesLoaded ">
14
+ < h3 > Recipe List</ h3 >
15
+
20
16
< nav id ="controls ">
21
17
< search-recipe
22
18
name-filter-string ="ctrl.nameFilter "
You can’t perform that action at this time.
0 commit comments