I am writing an Angular component that has a QueryList of HTMLElements and when iterating over the list, I am able to log each element to console. However when I try to access a property of the element it returns undefined. This is true for every property of the element. I have made sure that the elements are actually present in the list, but they are present as objects with the property 'nativeElement' Here is the console
Thank you for considering this.
@ViewChildren('element') elements !: QueryList<HTMLElement>
function()
{
this.elements.forEach(function(element) {
console.log(element) //prints object with correct data to console
console.log(element.className) //prints undefined
})
}