title: Change div width based on condition in angular 6
body: <p>I want to change the div width based on the following condition,</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div [ngStyle]="'width': selectedTab =='Home' ? '50%' : '100%'"&gt;
  
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am getting the tab which has been selected in "<strong>selectedTab</strong>".</p>
  
  <p>I have two tabs. </p>
  
  <p>1) Index</p>
  
  <p>2) Home</p>
  
  <p>If I select Index tab, The div width should be "<strong>100%</strong>". Incase If I select home tab, the div width should be "<strong>50%</strong>". I have written [ngStyle] condition but it is not working.</p>
  
  <p>Please help me how can I handle this situation.</p>