title: Handling more than two conditions in Angular 8
body: <p>I am trying to replace an existing ternary operator condition in Angular 8 but getting an error with the promised call. It no longer recognizes it as a promise. I have tried to use if else condition since I have three conditions to check. when I hover over the first method, it shows promise but when I hover over the new method, it shoes type assignment values</p>
  
  <p>Original method</p>
  
  <pre><code>public disapprove1 = (type: 'Reset' | 'Reject') =&gt; {
      const promise = type === 'Reset'
        ? this.service.reset(this.id, this.type, this.message)
        : this.service.reject(this.id, this.type, this.message);
  
      promise.then(() =&gt; {
        this.messageService.add(`Successfully ${type}.`, 'info');
        this.navigateToApprovalList();
      });
  }
  </code></pre>
  
  <p>New method</p>
  
  <pre><code>public disapprove = (type: 'Reset' | 'Reject' | 'Approve' ) =&gt; {
      if ( type  === 'Reset') {
         this.service.reset(this.id, this.type, this.message);
      } else if (type === 'Reject') {
         this.service.reject(this.id, this.type, this.message);
      } else if (type === 'Approve') {
        this.service.approve(this.id, this.type, this.message);
      }
      const promise = type;
  
      promise.then(() =&gt; {
        this.messageService.add(`Successfully ${type}.`, 'info');
        this.navigateToApprovalList();
      });
    }
  </code></pre>