I use nested ng-repeat and a filter for the object. The first ng-repeat is a filter for the headerId in the gapHeader object. The second ng-repeat filters gapSection, sectionId for the corresponding ID header.
I have an edit page that is in a separate modal window. The goal is to edit the content corresponding to the headerID and sectionID of the sub-object). It also has a separate control. Data is transmitted through the service.
My problem. I have a button for each gapSection subsector that opens the edit page mod, when I pass the value of $ index for the current section in each section of the service, do I get the index $, only the corresponding second ng-repeat? For example, if I press the 2 ng-repeat button on gapSection (headerId: 2, sectionId: 2), I get index $ 1. I require $ index of 2, which matches the position of the sub-object in gapSection,
Is it possible to pass a true $ index that matches the index $ defined in the original unfiltered gapSection? Please rate any comments about this and thank you!
An object:
var data ={ gapHeader:[{headerId:1,name:"General Requiremets",isApplicable:true}, {headerId:2,name:"Insurance",isApplicable:false}], gapSection:[{headerId:1,sectionId:1,requirement:"A facility is required to have company structure",finding:null,cmeasures:null,cprocedures:null,personResp:null,isAction:null}, {headerId:2,sectionId:1,requirement:"Organisation must have public liablity",finding:null,cmeasures:null,cprocedures:null,personResp:null,isAction:null}, {headerId:2,sectionId:2,requirement:"Facility must hold workers compensation insurance",finding:null,cmeasures:null,cprocedures:null,personResp:null,isAction:null}] };