带有ng-select的ng-filter嵌套的ng-repeat过滤器

黄金人生

我想用选择字段过滤表。选择值是嵌套的ng-repeat。(任务属于TomToy项目,我有一个任务列表...在每个任务中,都有另一个ng-repeat循环每个任务的项目。

这是我的过滤器选择:

<select
  ng-model="filterProject"
  ng-options="project.name for project in relatedprojects">
  <option>--</option>
</select>

这是我的ng-repeat表:

<tr ng-repeat="mission in missions | filter: { project : { name : filterProject }} ">
                            <td>
                                <span ng-if="mission.from_date != mission.to_date">
                                    [[mission.from_date]] -
                                    [[mission.to_date]]
                                </span>
                                <span ng-if="mission.from_date == mission.to_date">
                                    [[mission.from_date]]
                                </span>
                            </td>
                            <td>
                                <span ng-repeat='project in mission.projects'>
                                    [[project.name]]
                                </span>
                            </td>
.
.
.
.

当我加载该站点时,没有任何显示..没有过滤器,一切正常。我在这里做错了什么?

帕莎·萨拉蒂·戈什(Partha Sarathi Ghosh)

尝试这个

ng-repeat="mission in missions | filter: { projects : { name : filterProject.name }} "

这里分享了想法

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

在ng-repeat中动态应用格式过滤器

如何使用带有过滤器和$ index的ng-repeat?

ng-repeat过滤器的空值不显示

具有嵌套属性的ng表过滤器

与父值匹配的角嵌套ng-repeat过滤器项

如果未选择过滤器,则ng-repeat过滤器将“显示所有”项目

Angularjs错误:[filter:notarray]期望的数组,但收到:{},带有ng-repeat上的过滤器

离子角嵌套ng-repeat过滤器,如果为空则隐藏标题

AngularJS ng-repeat过滤器

带有嵌套ng-repeat的AngularJS Filter数组

ng-repeat:如何添加多个过滤器?

Ng-repeat过滤器的当前迭代值

AngularJS:ng-repeat过滤器,值大于

ng-Repeat(> 5)上的Angular Simple过滤器

如何动态禁用ng-repeat中的过滤器

AngularJS在带有排序过滤器的HTML表元素中的ng-repeat(键,值)对数据结构中嵌套ng-repat

AngularJS ng-repeat —声明式过滤器与命令式过滤器

Angular.js嵌套ng-repeat带有在过滤器中使用的表达式

ng-repeat的角度过滤器

如何使用带有ng-repeat的过滤器基于字段值过滤和对象

ng-repeat过滤器,并按标题重复

带有数字和日期的ng-repeat多重过滤器

Angular-在具有嵌套对象的ng-repeat上使用多个过滤器的麻烦

ng-if是否与ng-repeat过滤器冲突?

从ng-repeat角度动态移除过滤器

如何返回过滤器ng-repeat中的所有数据?

AngularJS - 如果 ng-repeat 为空并带有过滤器,则显示 div

在某些 ng-repeat 中添加过滤器

AngularJS ng-repeat 在带有过滤器的数组上