I am trying to generate a new array from this data and show only selected checkbox values from parent as well child.
this.data.ParentChildchecklist = [ { id: 1,value: 'Elenor Anderson',isSelected: false,isClosed:false, childList: [ { id: 1,parent_id: 1,value: 'child 1',isSelected: false }, { id: 2,parent_id: 1,value: 'child 2',isSelected: false } ] }, { id: 2,value: 'Caden Kunze',isSelected: false,isClosed:false,childList: [ { id: 1,parent_id: 1,value: 'child 1',isSelected: false }, { id: 2,parent_id: 1,value: 'child 2',isSelected: false } ] }, { id: 3,value: 'Ms. Hortense Zulauf',isSelected: false,isClosed:false, childList: [ { id: 1,parent_id: 1,value: 'child 1',isSelected: false }, { id: 2,parent_id: 1,value: 'child 2',isSelected: false } ] } ];
Tried this code to filter the selected list from parent and child to push to new List but its not working.
https://stackblitz.com/edit/angular-ivy-hfvrqa?file=src/app/app.component.ts
Aucun commentaire:
Enregistrer un commentaire