title: How to use tab in angular 6?
body: <p>I am trying to create a tab in angular 6 but when the app first loads all the tabs are visible and the links do not work.   </p>
  
  <pre><code>&lt;div ng-init="tab=1"&gt;
      &lt;div class="cb" ng-click="tab = 1"&gt;
        &lt;a [routerLink]='["/search"]' (click)='collapse()'&gt;
          &lt;span class='glyphicon glyphicon-search'&gt;&lt;/span&gt; Search
        &lt;/a&gt;
      &lt;/div&gt;
  
      &lt;div class="cb" ng-click="tab = 2"&gt;
        &lt;a [routerLink]='["/"]' (click)='collapse()'&gt;
          &lt;span class='glyphicon glyphicon-home'&gt;&lt;/span&gt; Home
        &lt;/a&gt;
      &lt;/div&gt;
  
      &lt;div ng-show="tab == 1"&gt;
        &lt;app-search-component&gt;&lt;/app-search-component&gt;
      &lt;/div&gt;
  
      &lt;div ng-show="tab == 2"&gt;
        &lt;p&gt;secondb&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>