Angular filter a object by its properties

后端 未结 6 2032
感情败类
感情败类 2020-11-30 04:47

I have an object with a series of object properties that is in the following similar structure (which is the way the data is coming back from a service):

{
          


        
6条回答
  •  一整个雨季
    2020-11-30 05:28

    Try this to filter object

    var rateSelected = $filter('filter')($scope.GradeList, function (obj) {
                            if(obj.GradeId == $scope.contractor_emp.save_modal_data.GradeId)
                            return obj;
                    });
    

提交回复
热议问题