andriangungon
9/17/2018 - 6:14 AM

prevent method calling multiple times

private subscribers: any = {};

ngOnInit() {
  //quick save
  this.subscribers.quickSave = this.jiraService.quickSave.subscribe((data: SimpleTicketModel) => {
      this.getDetailedTicket(data.key, false);      
  });  
}        

ngOnDestroy() {
    if(this.subscribers.quickSave) {
        this.subscribers.quickSave.unsubscribe();
    }
}