Angular: Async Validators don't unsubscribe when called repeatedly

Created on 9 Jun 2016  路  3Comments  路  Source: angular/angular

  • I'm submitting a ...
  • [X] bug report

Current behavior
Controls don't unsubscribe to the results of async validators when validation fires repeatedly

Expected/desired behavior
Only one subscription to an async validator is maintained.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem
    http://plnkr.co/edit/2NuNj1lBj2e6OdUJjFra?p=preview In the network console, one request is fired for each time the validator is called (i.e. each character). If you type 'user' you will get four requests. If you delete it and type it again, you'll get 9 requests (delete, plus typing again).
  • What is the expected behavior?
    There should only be one request, indicating only a single subscription.
  • What is the motivation / use case for changing the behavior?
  • Please tell us about your environment:
  • Angular version: 2.0.0-rc1
  • Browser: all | Chrome 50
  • Language: TypeScript 1.8
forms high community-help bufix

Most helpful comment

6895 linking this issue as I have added a lot of comments as to why this is occurring.

All 3 comments

6895 linking this issue as I have added a lot of comments as to why this is occurring.

12709, #10074 same problem.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings