title: Angular 2 - Adding a class when the div is reaching on browser top
body: <pre><code>&lt;div class="main-menu-wrapper home-menu **class to be added here**" &gt;
        &lt;div class="main-menu-inner"&gt;
            &lt;a href="#" class="home-logo"&gt;
                &lt;i class="logo"&gt;&lt;/i&gt;
  </code></pre>
  
  <p>i need to add a class when the div reaches the top of the browser,</p>
  
  <p><strong>Requirement</strong> is to start animation when each div hits on the top.
  (it's a single page website,with anchoring)</p>
  
  <p>how this can be done in angular 2;</p>