How can you get current positional information about an element in Angular2
<p>I have the <code>ElementRef</code> of my navbar and I'm trying to find out how close it is to the top of my window so I can make it sticky</p>

<pre><code>&lt;div class="nav-bar" #navBar&gt;

&lt;/div&gt;

@ViewChild("navBar")
  navBarElement;
</code></pre>

<p>I'm printing out the positions of it's nativeElement in a scroll event but the values seem to be static</p>

<pre><code>@HostListener('window:scroll', ['$event'])
onScroll(event) {
   console.log("offset top", this.navBarElement.nativeElement.offsetTop);
}
</code></pre>

<p>How can I track the current position of my element?</p>