r455
r455

Reputation: 143

AngularDart: ng-repeat filter update

I'm trying to apply a filter to a ng-repeat. But it's not updating when my model changes.

<th ng-repeat='column in cmp.columns | filter {visible:"true"}'>
  {{column.title}}
</th>

I'm getting the columns via a future in my component if thats makes any difference.

cols.getColumns().then ((columns){
  this.columns = columns;
})

Upvotes: 3

Views: 293

Answers (1)

r455
r455

Reputation: 143

Current workaround

moving the filter logic into my component:

List get visibleColumnNames => columns.where((col) => col['visible'] == true)
  .map((col) => col['name']).toList();

Still would like to know how to do this in the template with a filter.

Upvotes: 1

Related Questions