angulartypescriptangular6dragulaangular-dragula

Property 'forEach' does not exist on type 'NodeList'


I am using ng2-dragula for Drag and Drop in my Table.

  this.dragulaService.drop.subscribe(value => {     

  let questions_group = value[3] as HTMLTableRowElement        
  let SectionTwo:Array<string> = [];
  let QuestionId:Array<string> = [];
  let OrderNo:Array<number> = [];
  var list2 = questions_group.childNodes;      

  list2.forEach( 
    function(currentValue, currentIndex,listObj) { 

      if(currentIndex!=0){           
        let sectionName2 = currentValue.lastChild.textContent
        SectionTwo.push(sectionName2)
        QuestionId.push(currentValue.firstChild.textContent)
        OrderNo.push(currentIndex)

      }         
    },
    ''
  );   });

All of sudden it has started giving me error that "Property 'forEach' does not exist on type 'NodeList'.". Prior it was working fine I didn't do any changes.


Solution

  • I added property "dom.iterable" in lib in tsconfig.json and it worked