Check out example codes for "finally suscribe typescript". It will help you in understanding the concepts better.

Code Example 1

So the subscribe function takes three parameters:
onNext
onError
onCompleted

this._heroService.addHero(this.hero).subscribe(
      hero=> this.hero= hero,
      error => console.log("Error: ", error),
      function(){ this._router.navigate(['HeroDetail', { id: this.hero.id }]) }
    );

or 

this._heroService.addHero(this.hero).subscribe({
	next: event => { console.log(event) }, 
  	error: error => { console.log(error) }, 
   	complete: () => { console.log('complete') }
});

Learn ReactJs, React Native from akashmittal.com