我在我的表中使用 ng2-dragula 进行拖放。
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)
}
},
''
); });
突然之间,它开始给我一个错误,即“'NodeList'类型上不存在属性'forEach'。”。在它工作正常之前我没有做任何改变。