我是Angular JS的新手,我想在ng-repeat中放置过滤器,我有这样的json

    var data = [
    {name:test1,b1:{lastValue:0},b2:{lastValue:6},b3:{lastValue:6},b4:{lastValue:0}}
    {name:test2,b1:{lastValue:6},b2:{lastValue:0},b3:{lastValue:6},b4:{lastValue:0}}
{name:test3,b1:{lastValue:6},b2:{lastValue:0},b3:{lastValue:6},b4:{lastValue:0}}
    ]


我想在我测试过的lastValue上放置过滤器

ng-repeat = "d in data | filter:{*.lastValue:filterStatus}"

filterStatus // contain value of filter which user selected but its not working


我不知道该怎么办我尝试了google,但没有找到任何内容,请帮助我

最佳答案

<input ng-model="filterStatus" type="text">


您的filterStatus应该包含模型值

ng-repeat = "d in data | filter:filterStatus"

07-24 16:15