My code:
var checkboxes = this.element.querySelectorAll(\"input[type=checkbox]\") as NodeListOf;
checkboxes.forEach(ele =>
There is no guarantee forEach will exist on this type - it can, but not necessarily (e.g. in PhantomJS and IE), so TypeScript disallows it by default. In order to iterate over it you can use:
1) Array.from():
Array.from(checkboxes).forEach((el) => { /* do something */});
2) for-in:
for (let i in checkboxes) {
if (checkboxes.hasOwnProperty(i)) {
console.log(checkboxes[i]);
}
}