- When resizing the window, I am attempting to determine the width of a specific sub-component.
If I want to retrieve the entire app's width, I can use the following code:
@HostListener('window:resize', ['$event']) onResize(event) { event.target.innerWidth; console.log('Window resize: ' + event.target.innerWidth); }
However, I'm uncertain about how to focus ONLY on a particular sub-component and obtain its width during window resizing.
<div class = 'panel-2'></div>
If anyone has insight into what steps I might be overlooking, please let me know. Thank you very much in advance!
<div class = "main">
<div class = 'left-section'>Left bar</div>
<div class = 'right-section'>
<div class = 'panel-1'></div>
<div class = 'panel-2'></div>
</div>
</div>