dart-archive / angular.dart.tutorial

AngularDart tutorial
MIT License
234 stars 89 forks source link

Use arrayify formatter instead of keys.toList() #120

Open benbro opened 10 years ago

benbro commented 10 years ago

Using the arrayify formatter in the template instead of the _categories list will simplify the code:

<span ng-repeat="category in cmp.categoryFilterMap | arrayify">
  <label>
    <input type="checkbox"
     ng-model="cmp.categoryFilterMap[category.key]">{{category.key}}
  </label>
</span>

https://github.com/angular/angular.dart.tutorial/blob/master/Chapter_06/lib/component/search_recipe_component.html#L10

https://github.com/angular/angular.dart.tutorial/blob/master/Chapter_06/lib/component/search_recipe_component.dart#L20

Arrayify formatter: https://github.com/angular/angular.dart/commit/d2780f8bb849c62d995d939d00594ebe93428631