AngularJs Remove duplicate elements in ng-repeat

前端 未结 5 1016
醉话见心
醉话见心 2020-11-30 01:43

I have one dictionary which is stored in field_detail

  • {{field.displayName}}
  • 5条回答
    •  离开以前
      2020-11-30 02:14

      Create your own function:

      productArray =[];
      angular.forEach($scope.leadDetail, function(value,key){
      var index = $scope.productArray.indexOf(value.Product);
      if(index === -1)
      {
          $scope.productArray.push(value.Product);
      }
      

      });

    提交回复
    热议问题