Hi I am working with Angular2 Web app , After View Initialized i need to trigger a function But I got error , I have followed the official angular2 site <https://angular.io/docs/ts/latest/api/core/index/AfterContentInit-class.html>

**Error :**
 EXCEPTION: Uncaught (in promise): ReferenceError: ngAfterViewInit is not defined
 ReferenceError: ngAfterViewInit is not defined

**Code :**

```
import { Component   }  from '@angular/core' ;
import { DropDown   }  from '../services/dropdown';
import {ExponentialStrengthPipe} from '../exponential-strength.pipe';
import {HashLocationStrategy, Location, LocationStrategy} from '@angular/common';
@Component({

        selector:'pageone',
        templateUrl:'app/page1/page1.component.html',
        providers:[DropDown,Location, {provide: LocationStrategy, useClass: HashLocationStrategy}]

})

export class Page1Component implements AfterViewInit    
{
        ind:number=1.5;
        usa:number=1.5;
        myd:any;
        search:string;
        mydetails:any;
        constructor(private mydata:DropDown,location: Location){

        this.myd = mydata.getData();
        this.mydata.getMyprofile().subscribe(posts=>{
            console.log(posts);
            this.mydetails=posts;
        });
ngAfterViewInit() {
    // ...
  }
}

        addLocation(){
            if(this.search=="" || this.search==undefined)
            {
                alert("Please enter loction");
            }
            else
            {
                for(var i=0;i<this.myd.length;i++)
                   {    var count=0;
                        if(this.myd[i].locationName==this.search)
                        {
                        alert("Already Present")
                        count=1;
                        }                       
                   }    
                   if(count==0)
                   {
                        var id = this.myd.length+1;
                        this.myd.push({id:id,locationName:this.search});
                        alert(this.search+" Has Been Added ");

                   }

            }
      }
}

```

**Function need to be called** 

```
ngAfterViewInit() {
    // ...
  }

```