(bug): 3rd party promises on $asyncValidators inconsistently applies ng-invalid class or stuck with ng-pending #11700
Description
It seems that using Bluebird makes the ng-invalid / ng-pending classes to be intermittent, even if the model is valid.
Notice the flicker on the first input http://plnkr.co/edit/y5OEDwK45P1OAplCigQi?p=preview typing at a fast speed. sometimes it works, sometimes it flickers.
The second input is using $q, and it's flawless, remains invalid, since it's always immediately resolving.
If you watch with developers tools, you can see the class is added / removed intermittently. When using $q, it doesn't happen.
Is it a problem with bluebird or with the promise resolution in Angular? (or I need to throw a $scope.$applyAsync in the bunch).
the effect becomes pronounced when using sibling validator CSS rules with icons, they blink like mad.
I'm also getting random "stuck on pending" with 3rd lib promise, where it never sets the class to "ng-valid" but keeps the "ng-pending". the problem is even more pronounced when there's more than one then
chain