title: Angular 4: ERROR CONTEXT <failed to convert exception to string>
body: <p>I am trying to write code for Base Converter from decimal to binary,octal and hexa in Angular 4.  But I am getting 'Maximum Call Stack Exceeded'.</p>
  
  <p>Here is the current code with the error.</p>
  
  <p><strong>Html</strong></p>
  
  <pre><code>&lt;form class="container" [formGroup]="form"&gt;
  &lt;input type="text" (ngModelChange)="decimalChanged(oldValue , newValue = $event)" name="decimal" placeholder="decimal" formControlName="decimal"/&gt;
  &lt;br/&gt;&lt;br/&gt;
  &lt;input type="text" (ngModelChange)="binaryChanged(oldValue , newValue = $event)" name="binary" placeholder="binary" formControlName="binary"/&gt;
  &lt;br/&gt;&lt;br/&gt;
  &lt;input type="text"  (ngModelChange)="octalChanged(oldValue , newValue = $event)" name="octal" placeholder="octal" formControlName="octal"/&gt;
  &lt;br/&gt;&lt;br/&gt;
  &lt;input type="text" (ngModelChange)="hexaChanged(oldValue , newValue = $event)" name="hexa" placeholder="hexa" formControlName="hexa"/&gt;
  &lt;br/&gt;&lt;br/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>ts</strong></p>
  
  <pre><code>import { Component } from '@angular/core';
  import { FormGroup, FormControl } from '@angular/forms';
  
  @Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
  })
  export class AppComponent {
  
    form;
    ngOnInit(){
        this.form= new FormGroup ({
            decimal : new FormControl(""),
            binary : new FormControl(""),
            octal  : new FormControl(""),
            hexa  : new FormControl(""),
        })
    }
  
    decimalChanged = function(oldValue, newValue){
      if(newValue != ""){
               this.form.patchValue({binary:parseInt(newValue,10).toString(2)});
               this.form.patchValue({octal:parseInt(newValue,10).toString(8)});
               this.form.patchValue({hexa:parseInt(newValue,10).toString(16)});
               }else{
              this.form.patchValue({binary:""});
               this.form.patchValue({octal:""});
               this.form.patchValue({hexa:""});
               }
    }
  
    b=0;
    o=0;
    h=0;
  
    binaryChanged = function(oldValue, newValue){
     this.b=this.b+1;
     if(this.b==1){
       if(newValue != ""){
             this.form.patchValue({decimal:parseInt(newValue,2).toString(10)});
        }else{
             this.form.patchValue({decimal:""});
        }
     }
      this.b=0;
    }
  
   octalChanged = function(oldValue, newValue){
     this.o=this.o+1;
        if(this.o==1){
          if(newValue != ""){
             this.form.patchValue({decimal:parseInt(newValue,8).toString(10)});
          }else{
             this.form.patchValue({decimal:""});
         }
        }
        this.o=0;
    }
  
   hexaChanged = function(oldValue, newValue){
     this.h=this.h+1;
        if(this.h==1){
        if(newValue != ""){
             this.form.patchValue({decimal:parseInt(newValue,16).toString(10)});
        }else{
             this.form.patchValue({decimal:""});
          }
        }
        this.h=0;
    }
  
  
  }
  </code></pre>
  
  <p>I get the folowing error provided in screenshot. </p>
  
  <p><a href="https://i.stack.imgur.com/H0UZV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H0UZV.png" alt="enter image description here"></a></p>