0

Guys I have two arrays to map in each rows column,so first loop in some column of the row successfully mapped with ng-repeat but I have other loop in the same row to map few column in the same row. So can I use ng-repeat here, how do I deal with this issue?

<tr ng-repeat="x in liveclaimdata"  ng-repeat="y in hxdata"   line-height="24px" id="row_{{$index+1}}" >
      
    <td></td>
    <td></td>
    <td></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td id="{{$index+1}}_payer"></td>
    <td id="{{$index+1}}_payer"></td>
    <td id="{{$index+1}}_denials" ng-required="false" >{{x.denials}}</td>
    <td id="{{$index+1}}_low_reimb">{{x.low_reimb}} </td>
    <td id="{{$index+1}}_bundling">{{x.bundling}}</td>
    <td id="{{$index+1}}_payer_rating">{{x.payer_rating}}</td>
    <td id="{{$index+1}}_mr_request">{{x.mr_request}}</td>
    <td id="{{$index+1}}_appeal_percentage">{{x.appeal_percentage}}</td>
    <td id="{{$index+1}}_appeal_paid_percentage">{{x.appeal_paid_percentage}}</td>
 
    <td>Test  {{y.denials}} </td>
  
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
</tr>

Here ng-repeat="y in hxdata" is not working.

Live data array

0
:
$$hashKey
:
"object:61"
appeal_paid_percentage

:
"0"
appeal_percentage
:
"0"
bundling
:
"0"
cpt
:
"35301"
denials
:
"0"
low_reimb
:
"1"
mr_request
:
"0"
payer
:
"AETNA INSURANCE - TRS/KY"
payer_rating
:
"0"
row_num
:
"0"
1
:
$$hashKey
:
"object:62"
appeal_paid_percentage
:
null
appeal_percentage
:
null
bundling
:
null
cpt
:
"26370"
denials
:
null
low_reimb
:
null
mr_request
:
null
payer
:
"AETNA INSURANCE - TRS/KY"
payer_rating
:
null
row_num
:
"1"
__p

Similar structure in hx data

6
  • Is the length same? Commented Apr 27, 2018 at 5:17
  • rest of the column I need to fill up with hxdata ,I couldnt undetstood about the length Commented Apr 27, 2018 at 5:19
  • Can you please post some sample data and expected output Commented Apr 27, 2018 at 5:23
  • in liveclaimdata its array parsed as out put as 0 0 0 3 0 0 0 json sample as {"status":"Success","data":[{"row_num":"0","payer":"AETNA INSURANCE - TRS\/KY","cpt":"35301","denials":"0","low_reimb":"1","bundling":"0","payer_rating":"0","mr_request":"0","appeal_percentage":"0","appeal_paid_percentage":"0"}, Commented Apr 27, 2018 at 5:25
  • @RAJMOHAN Please add liveclaimdata array... & ... hxdata array Commented Apr 27, 2018 at 5:26

2 Answers 2

1

Based on my understanding about the problem, you have related data in 2 arrays and you want to use ng-repeat to paint it.

Update (remove second ng-repeat)

<tr ng-repeat="x in liveclaimdata"  ng-repeat="y in hxdata"   line-height="24px" id="row_{{$index+1}}" >

to

<tr ng-repeat="x in liveclaimdata" line-height="24px" id="row_{{$index+1}}" >

and

Update (use the index to iterate over second array)

<td>Test  {{y.denials}} </td>

to

<td>Test  {{hxdata[$index].denials}} </td>
Sign up to request clarification or add additional context in comments.

Comments

0

This can be solved in another methode.by creating a function in $scope at contoller constructor

$scope.livedatamapping=function(response){   
                     $.each(response.data, function(key, value){    
                             var row = parseInt(key)+1;   
                       $('#'+row+'_appeal_paid_percentage').html(value.appeal_paid_percentage);
                       $('#'+row+'_appeal_percentage').html(value.appeal_percentage);
                       $('#'+row+'_bundling').html(value.bundling);
                       $('#'+row+'_denials').html(value.denials); 
                       $('#'+row+'_low_reimb').html(value.low_reimb);
                       $('#'+row+'_mr_request').html(value.mr_request); 
                       $('#'+row+'_payer_rating').html(value.payer_rating);
                         $scope.edidataLoader=false;
                       //$scope.claimdataLoader=false;
                 }); 
    } 

and then map each value to the html mapper.Thats it

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.