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

Commit ec08bf9

Browse files
committed
Merge branch 'master' into patch-chap3-comp
Conflicts: Chapter_07/lib/rating/rating_component.dart - resolved.
2 parents fc77878 + 6dd9d1e commit ec08bf9

File tree

13 files changed

+24
-32
lines changed

13 files changed

+24
-32
lines changed

Chapter_03/web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ <h3>Recipe List</h3>
1717
</li>
1818
</ul>
1919

20-
<h3>Recipe Details</h3>
2120
<div ng-if="ctrl.selectedRecipe != null">
21+
<h3>Recipe Details</h3>
2222
<div><strong>Name: </strong>{{ctrl.selectedRecipe.name}}</div>
2323
<div><strong>Category: </strong>{{ctrl.selectedRecipe.category}}</div>
2424
<div><strong>Rating: </strong>

Chapter_04/web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ <h3>Recipe List</h3>
1919
</li>
2020
</ul>
2121

22-
<h3>Recipe Details</h3>
2322
<div ng-if="ctrl.selectedRecipe != null">
23+
<h3>Recipe Details</h3>
2424
<div><strong>Name: </strong>{{ctrl.selectedRecipe.name}}</div>
2525
<div><strong>Category: </strong>{{ctrl.selectedRecipe.category}}</div>
2626
<div><strong>Rating: </strong>

Chapter_05/web/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link rel="stylesheet" href="style.css">
66
</head>
77
<body ng-cloak>
8-
8+
99
<div recipe-book>
1010
<div ng-if="!ctrl.recipesLoaded || !ctrl.categoriesLoaded">
1111
{{ctrl.message}}

Chapter_05/web/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ class MyAppModule extends Module {
2828
void main() {
2929
ngBootstrap(module: new MyAppModule());
3030
}
31-

Chapter_06/lib/component/search_recipe_component.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class SearchRecipeComponent {
1212
String nameFilterString = "";
1313

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

17-
get categories {
17+
List<String> get categories {
1818
return categoryFilterMap.keys.toList();
1919
}
2020

Chapter_06/lib/component/view_recipe_component.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ViewRecipeComponent {
1515

1616
String _recipeId;
1717

18-
get recipe {
18+
Recipe get recipe {
1919
return recipeMap[_recipeId];
2020
}
2121

Chapter_06/lib/component/view_recipe_component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div>
1+
<div id="recipe-details">
22
<h3>Recipe Details</h3>
33
<div ng-if="ctrl.recipe != null">
44
<a class="extra-space" href="#/recipe/{{ctrl.recipe.id}}/edit">

Chapter_06/lib/recipe_book.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ kitchen and took the recipe book with him!""";
2525
bool categoriesLoaded = false;
2626

2727
// 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;
3030
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();
3333

3434
// Filter box
3535
Map<String, bool> categoryFilterMap = {};

Chapter_06/web/index.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
77
<body ng-cloak>
88

99
<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-
1510
<div ng-if="!ctrl.recipesLoaded || !ctrl.categoriesLoaded">
1611
{{ctrl.message}}
1712
</div>
18-
1913
<div ng-if="ctrl.recipesLoaded && ctrl.categoriesLoaded">
14+
<h3>Recipe List</h3>
15+
2016
<nav id="controls">
2117
<search-recipe
2218
name-filter-string="ctrl.nameFilter"

Chapter_07/lib/component/search_recipe_component.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ import 'package:angular/angular.dart';
55
@NgComponent(
66
selector: 'search-recipe',
77
templateUrl: 'packages/angular_dart_demo/component/search_recipe_component.html',
8-
publishAs: 'ctrl',
9-
map: const {
10-
'name-filter-string': '<=>nameFilterString',
11-
'category-filter-map' : '<=>categoryFilterMap'
12-
}
8+
publishAs: 'ctrl'
139
)
1410
class SearchRecipeComponent {
11+
@NgTwoWay('name-filter-string')
1512
String nameFilterString = "";
13+
14+
@NgTwoWay('category-filter-map')
1615
Map categoryFilterMap;
1716

1817
get categories {

Chapter_07/lib/component/view_recipe_component.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ import 'package:angular/angular.dart';
88
templateUrl: 'packages/angular_dart_demo/component/view_recipe_component.html',
99
cssUrl: 'packages/angular_dart_demo/component/view_recipe_component.css',
1010
publishAs: 'ctrl',
11-
map: const {
12-
'recipe-map':'<=>recipeMap'
13-
},
1411
exportExpressions: const['name']
1512
)
1613
class ViewRecipeComponent {
14+
@NgTwoWay('recipe-map')
1715
Map<String, Recipe> recipeMap;
16+
1817
String _recipeId;
1918

2019
get recipe {

Chapter_07/lib/rating/rating_component.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ library rating;
33
import 'package:angular/angular.dart';
44

55
/* Use the @NgComponent annotation to indicate that this class is an
6-
* Angular Component.
6+
* Angular component.
77
*
88
* The selector field defines the CSS selector that will trigger the
99
* component. Typically, the CSS selector is an element name.
@@ -31,7 +31,7 @@ import 'package:angular/angular.dart';
3131
selector: 'rating',
3232
templateUrl: 'packages/angular_dart_demo/rating/rating_component.html',
3333
cssUrl: 'packages/angular_dart_demo/rating/rating_component.css',
34-
publishAs: 'cmp'
34+
publishAs: 'ctrl'
3535
)
3636
class RatingComponent {
3737
static const String _starOnChar = "\u2605";

Chapter_07/lib/tooltip/tooltip_directive.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ import 'dart:math';
55
import 'package:angular/angular.dart';
66

77
@NgDirective(
8-
selector: '[tooltip]',
9-
map: const {
10-
'tooltip': '=>displayModel'
11-
}
8+
selector: '[tooltip]'
129
)
1310
class Tooltip {
1411
dom.Element element;
1512
Scope scope;
13+
14+
@NgOneWay('tooltip')
1615
TooltipModel displayModel;
1716

1817
dom.Element tooltipElem;

0 commit comments

Comments
 (0)