title: how to get first element in angular 5 using ngFor directive?
body: <p>ngFor directive worked fine when I used to show all the colors from an array of colors but when I tried to check whether it is first element of the array or not then it shows an error "can't bind to ngForFirst since it is not .... blah blah blah ". It shows almost a page full of error. I'm very new to angular and the tutorial I'm going through the tutor doesn't get any error. Don't know why. Help me</p>
  
  <pre><code>    import { Component, OnInit } from '@angular/core';
  
      @Component({
       selector: 'app-test',
       template: `
         &lt;div *ngFor = "let color of colors; first as i"&gt;
             &lt;h3&gt; {{i}}  &lt;/h3&gt;
         &lt;/div&gt;` ,
       styles: []
      })
  
      export class TestComponent implements OnInit {
        public name = "Dipesh";
        public colors = ["Red", "Black", "Green"];
        constructor() { }
  
        ngOnInit() {
        }
  
        }
  </code></pre>