title: angular 5 and 6 switch case
body: <p>hey guys what seems to be the problem here? I'm using switch case in the view. But it doesn't seems to be working.</p>
  
  <pre><code>template: `
    &lt;div [ngSwitch]="color"&gt;
      &lt;div *ngSwitchCase"'red'"&gt;You picked red&lt;/div&gt;
      &lt;div *ngSwitchCase"'green'"&gt;you picked green&lt;/div&gt;
      &lt;div *ngSwitchCase"'blue'"&gt;You picked blue&lt;/div&gt;
    &lt;/div&gt;
  
  `,
  styles: [`
  
  `]
  })
  </code></pre>
  
  <p>This is the component file.</p>
  
  <pre><code>export class TestComponent implements OnInit {
  
      public color = "red";
      constructor() { }
  
      ngOnInit() {
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/aNxHS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aNxHS.png" alt="Here is the image attached"></a></p>