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

Commit 3aa0c38

Browse files
committed
Make all chapters' samples more consistent and up to date
Review URL: https://codereview.appspot.com/58320043
1 parent f937241 commit 3aa0c38

21 files changed

+85
-95
lines changed

Chapter_01/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
"Hello World" Angular Dart application
1+
"Hello World" AngularDart application
22

Chapter_02/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Recipe Book Angular Dart application
2-
Illustrates how to create a basic Angular Controller
1+
Recipe Book AngularDart application
2+
Illustrates how to create a basic Angular controller
33

Chapter_03/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Recipe Book Angular Dart application
2-
Illustrates the use of an Angular Component
1+
Recipe Book AngularDart application
2+
Illustrates the use of an Angular component
33

Chapter_03/lib/rating/rating_component.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ import 'package:angular/angular.dart';
3030
selector: 'rating',
3131
templateUrl: 'packages/angular_dart_demo/rating/rating_component.html',
3232
cssUrl: 'packages/angular_dart_demo/rating/rating_component.css',
33-
publishAs: 'ctrl',
34-
map: const {
35-
'max-rating' : '@maxRating',
36-
'rating' : '<=>rating'
37-
}
33+
publishAs: 'cmp'
3834
)
3935
class RatingComponent {
4036
static const String _starOnChar = "\u2605";
@@ -44,8 +40,10 @@ class RatingComponent {
4440

4541
List<int> stars = [];
4642

43+
@NgTwoWay('rating')
4744
int rating;
4845

46+
@NgAttr('max-rating')
4947
set maxRating(String value) {
5048
stars = [];
5149
var count = value == null ? 5 : int.parse(value);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<span class="stars"
2-
ng-if="ctrl.rating != null"
3-
ng-repeat="star in ctrl.stars"
4-
ng-click="ctrl.handleClick(star)"
5-
ng-class="ctrl.starClass(star)">
6-
{{ctrl.starChar(star)}}
2+
ng-if="cmp.rating != null"
3+
ng-repeat="star in cmp.stars"
4+
ng-click="cmp.handleClick(star)"
5+
ng-class="cmp.starClass(star)">
6+
{{cmp.starChar(star)}}
77
</span>

Chapter_04/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Recipe Book Angular Dart application
2-
Illustrates the use of an Angular Directive
1+
Recipe Book AngularDart application
2+
Illustrates the use of an Angular directive
33

Chapter_04/lib/rating/rating_component.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import 'package:angular/angular.dart';
2222
*
2323
* <rating max-rating="5" rating="mycontrol.rating">
2424
*
25-
* The compnoent's public fields are available for data binding from the
25+
* The component's public fields are available for data binding from the
2626
* component's view. Similarly, the component's public methods can be
2727
* invoked from the component's view.
2828
*/
@@ -33,10 +33,10 @@ import 'package:angular/angular.dart';
3333
publishAs: 'cmp'
3434
)
3535
class RatingComponent {
36-
String _starOnChar = "\u2605";
37-
String _starOffChar = "\u2606";
38-
String _starOnClass = "star-on";
39-
String _starOffClass = "star-off";
36+
static const String _starOnChar = "\u2605";
37+
static const String _starOffChar = "\u2606";
38+
static const String _starOnClass = "star-on";
39+
static const String _starOffClass = "star-off";
4040

4141
List<int> stars = [];
4242

Chapter_05/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Recipe Book Angular Dart application
2-
Illustrates the use of Filters and Services
1+
Recipe Book AngularDart application
2+
Illustrates the use of filters and services
33

Chapter_05/lib/rating/rating_component.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,28 @@ import 'package:angular/angular.dart';
2222
*
2323
* <rating max-rating="5" rating="mycontrol.rating">
2424
*
25-
* The compnoent's public fields are available for data binding from the
25+
* The component's public fields are available for data binding from the
2626
* component's view. Similarly, the component's public methods can be
2727
* invoked from the component's view.
2828
*/
2929
@NgComponent(
3030
selector: 'rating',
3131
templateUrl: 'packages/angular_dart_demo/rating/rating_component.html',
3232
cssUrl: 'packages/angular_dart_demo/rating/rating_component.css',
33-
publishAs: 'ctrl',
34-
map: const {
35-
'max-rating' : '@maxRating',
36-
'rating' : '<=>rating'
37-
}
33+
publishAs: 'cmp'
3834
)
3935
class RatingComponent {
40-
String _starOnChar = "\u2605";
41-
String _starOffChar = "\u2606";
42-
String _starOnClass = "star-on";
43-
String _starOffClass = "star-off";
36+
static const String _starOnChar = "\u2605";
37+
static const String _starOffChar = "\u2606";
38+
static const String _starOnClass = "star-on";
39+
static const String _starOffClass = "star-off";
4440

4541
List<int> stars = [];
4642

43+
@NgTwoWay('rating')
4744
int rating;
4845

46+
@NgAttr('max-rating')
4947
set maxRating(String value) {
5048
stars = [];
5149
var count = value == null ? 5 : int.parse(value);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<span class="stars"
2-
ng-if="ctrl.rating != null"
3-
ng-repeat="star in ctrl.stars"
4-
ng-click="ctrl.handleClick(star)"
5-
ng-class="ctrl.starClass(star)">
6-
{{ctrl.starChar(star)}}
2+
ng-if="cmp.rating != null"
3+
ng-repeat="star in cmp.stars"
4+
ng-click="cmp.handleClick(star)"
5+
ng-class="cmp.starClass(star)">
6+
{{cmp.starChar(star)}}
77
</span>

0 commit comments

Comments
 (0)