title: Angualr4, Wait after 3 invalid login attempts
body: <p>I am working on an login form in Angular4. I would like to implement a 30 seconds wait (by disabling button) after entering 3 invalid credentials. After the next 3 invalid attempts, waiting time will just double, 60 seconds, 120 seconds so on and so forth. I initiatialized a counter and decrement it in each invalid form submissions. And used setTimeInterval like:</p>
  
  <pre><code>initCounter() {
      this.intervalTimer = setInterval(() =&gt; {
          let count = this.counter;
          if (count &gt; 0) {
              this.counter = count - 1;
          }
      }, 1000);
  }
  </code></pre>
  
  <p>However I couldn't complete this task as expected. </p>
  
  <p>Hope someone can help me.</p>