I am attempting to retrieve the width of an element using JavaScript in my Angular application.
document.getElementsByClassName("element")[0].offsetWidth;
However, I keep encountering the following compilation error:
Property 'offsetWidth' does not exist on type 'Element'.
Could someone provide guidance on how to use it in Angular 4? Thank you.