Keep it as a best pratices that implements OnInit, OnDestroy. Then insidengOnInit, we call service to fetch data back. And inngOnDestroy, we unsubscribe the Observable. import {Component, ElementRef, EventEmitter, Output, OnInit, OnDestroy}from'angular2/core'; import {Observable}from'rxjs/R...
Keep it as a best pratices that implements OnInit, OnDestroy. Then insidengOnInit, we call service to fetch data back. And inngOnDestroy, we unsubscribe the Observable. import {Component, ElementRef, EventEmitter, Output, OnInit, OnDestroy}from'angular2/core'; import {Observable}from'rxjs/R...