Shailen Tuli
Shailen Tuli

Reputation: 14161

Filtering using a function in Angular Dart 0.9.10

I had code for filtering the output of an ng-repeat using a function as a filter, but it has stopped working once I upgraded to 0.9.10. The filtering does still happen, but I get the pesky "Observer reaction functions should not change model" error message.

Here is the relevant Dart code:

class User {
  String name;
  User(this.name);
}

@NgController(
    selector: '[my-controller]',
    publishAs: 'ctrl'
)
class MyController {
  List<User> users = [
    new User('Hannah'),
    new User('Mary'),
    new User('Otto'),
  ];

  bool isPalindrome(user) {
    ...
  }
}

And here is the relevant HTML:

<div ng-repeat="user in ctrl.users | filter:ctrl.isPalindrome">
  {{user.name}}
</div>

How can I get this to work again?

Upvotes: 1

Views: 146

Answers (1)

Shailen Tuli
Shailen Tuli

Reputation: 14161

This is a bug. See https://github.com/angular/angular.dart/issues/800. H/T James DeBoer of the Angular team.

Upvotes: 1

Related Questions