Angular ng-repeat filter with greater than

狂风中的少年 提交于 2019-12-04 21:31:00

http://jsfiddle.net/odpw6c6q/43/

In ng-options use ng-options="property.data.Bedrooms as instead of ng-options="property.data.SubType as because data.Bedrooms is the property that contains number of bedrooms which should be stored in ng-model

In scope add this function

//Filter Function
    $scope.greaterThan = function(bedrooms) {
        return function(item) {                          
            if ( item['Bedrooms'] > bedrooms) {                
                return true;
            } else {                
                return false;
            }
        }
    };

In ng-repeat use filter: greaterThan(Bedrooms) instead of filter:{Bedrooms:Bedrooms}

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!