I just started to learning from this tutorial: https://github.com/angular/angular.dart.tutorial/wiki/Creating-a-Custom-Component
I'm just stucked with a problem, and looking for some help. The rating component does not show for me, none of the methods called (at least not at any breakpoint). Here you can see the code: https://www.dropbox.com/s/oizzl9k6nclgoqd/SecondAngularDart.zip
Please help me with some guidence, how can I debug a situation like this? Or what the problem is?
@NgComponent(
selector:'rating',
templateUrl:'rating_component.html',
cssUrl:'rating_component.css',
publishAs:'cmp'
)
class RatingComponent {
static const String _starOnChar = "\u2605";
static const String _starOffChar = "\u2606";
static const String _starOnClass = "star-on";
static const String _starOffClass = "star-off";
List<int> stars = [];
@NgTwoWay('rating')
int rating;
@NgAttr('max-rating')
int maxRating(String max) {
stars = [];
var count = max == null ? 5 : int.parse(max);
for(var i=1; i <= count; i++) {
stars.add(i);
}
}
String starClass(int star) {
return star > rating ? _starOffClass : _starOnClass;
}
String starChar(int star) {
return star > rating ? _starOffChar : _starOnChar;
}
void handleClick(int star) {
if (star == 1 && rating == 1) {
rating = 0;
} else {
rating = star;
}
}
}