title: Angular2 Menu bootstrap
body: <p>I have build a menu with a toggle, it works fine.
  When a user clicks a link I want the menu to collapse again.
  I did this by making my own function this also works.</p>
  
  <p>The issue I have now is that the toggle uses a nice transition when the menu collapse. I use show and hide so there is no transition I thought the transition w was reguladed by the css in bootstrap but I think this is not the case.</p>
  
  <p>How can I add a nice transition to my menu when a link gets clicked.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;nav class="navbar navbar-default  navbar-static-top"&gt;
      &lt;div class="container-fluid"&gt;
          &lt;div class="navbar-header"&gt;
              &lt;a class="navbar-brand" href="#"&gt;MyMenu&lt;/a&gt;
              &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNav" &gt;
                  &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
                  &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;span class="icon-bar"&gt;&lt;/span&gt;
                  &lt;span class="icon-bar"&gt;&lt;/span&gt;
              &lt;/button&gt;
          &lt;/div&gt;
          &lt;div class="collapse navbar-collapse" id="myNav"&gt;
              &lt;ul class='nav navbar-nav navbar-right'&gt;
                  &lt;li&gt;&lt;a [routerLink]="['/info']" (click)="closeMenu()"&gt;&lt;/span&gt;&lt;br/&gt;Info&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a [routerLink]="['/aboutus']" (click)="closeMenu()"&gt;&lt;br/&gt;aboutus&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a [routerLink]="['/contact']" (click)="closeMenu()"&gt;&lt;br/&gt;contact&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/nav&gt;
  </code></pre>