title: RangeError: Maximum call stack size exceeded angular 2
body: <p>I am using ionic 2</p>
  
  <p>Here is my code....</p>
  
  <pre><code>&lt;div class="messagesholder" 
        *ngFor="let chat of chatval | orderby:'[date]'; let i = index;let first=first;let last = last;"&gt;
             {{last ? callFunction() : ''}} 
  
         &lt;div *ngIf="chat.sender == currentuser || chat.receiver == currentuser" &gt;
         {{checkdate(chat.date)}} 
         &lt;p class="chat-date"  id="abc" #abc&gt;{{msgdate | amDateFormat:'LL'}}&lt;/p&gt;
  
  &lt;/div&gt; 
  </code></pre>
  
  <p>Here is my checkdate function</p>
  
  <pre><code>checkdate(date)
    {
      var res = date.split(" ");
      var A=res[0];
      var local=localStorage.getItem('chatdate');
      this.msgdate="";
      if(local === undefined || local === null)
      {
        this.msgdate=A;
        localStorage.setItem('chatdate',this.msgdate);
  
      }
      else if(local !== undefined)
      {
        console.log(local != A);
        if(local != A)
        {
  
          this.msgdate = A;
           localStorage.setItem('chatdate',this.msgdate);
        }
      }
  
     }
  
      callFunction(){
      this.content.scrollToBottom(0)
    }
  </code></pre>
  
  <p>It's work.But I getting this error.</p>
  
  <blockquote>
    <p>FIREBASE WARNING: Exception was thrown by user callback. Error:
    Expression has changed after it was checked. Previous value: 'April
    10, 2017'. Current value: ''.</p>
  </blockquote>
  
  <p>Because I go this working by having these lines in my code :</p>
  
  <pre><code>constructor(private cdRef: ChangeDetectorRef) {}
  
  ngAfterViewChecked() {
  //explicit change detection to avoid "expression-has-changed-after-it-was-checked-error"
  this.cdRef.detectChanges();
  }
  </code></pre>
  
  <p>But Now I am getting this error</p>
  
  <blockquote>
    <p>database.js:62 FIREBASE WARNING: Exception was thrown by user
    callback. RangeError: Maximum call stack size exceeded</p>
  </blockquote>