【问题标题】:AngularDart: ng-repeat filter updateAngularDart:ng-repeat 过滤器更新
【发布时间】:2014-08-24 14:04:44
【问题描述】:

我正在尝试对ng-repeat 应用过滤器。但是当我的模型发生变化时它不会更新。

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

如果这有什么不同,我将通过组件中的未来获取列。

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

【问题讨论】:

    标签: dart angular-dart


    【解决方案1】:

    当前的解决方法

    将过滤器逻辑移动到我的组件中:

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

    仍然想知道如何在带有过滤器的模板中执行此操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-18
      • 1970-01-01
      • 1970-01-01
      • 2014-06-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多