Get width and height of child component with NgIf applied
<p>I have a parent component with a child that populates itself using <code>NgFor</code>. The parent defines a property <code>childIsVisible = false</code> and binds the child to it with <code>*ngIf="childIsVisible"</code> so initially the child is not displayed.</p>

<p>Later on I want to flip <code>childIsVisible</code> to <code>true</code> so that the child component appears and I want to position the child based on it's width.</p>

<p>My problem is that within the parent method that flips the visibility I can't get the child's width because it not yet being displayed. What I want is some method of toggling visibility on then, once the child component is being displayed, get its width and position it accordingly.</p>

<p>I have looked at using <code>AfterContentChecked</code> but this seems a bit heavy handed as it is called pretty much constantly.</p>

<p>Hope this makes sense, any thoughts on different ways to approach this would be great.</p>

<p>Cheers   </p>