formly-js / angular-formly

JavaScript powered forms for AngularJS
http://docs.angular-formly.com
MIT License
2.23k stars 406 forks source link

fix(FormlyFormController): Fix validateOnModelChange not firing with promise change #523 #728

Closed Rybbow closed 7 years ago

Rybbow commented 7 years ago

What

In FormlyFormController in function validateFormControl variable validate was invoked with "undefined" this if the function was called with a promise.

Why

It's a bug.

How

Used a closure and apply() to ensure validate() will be called with formController as this.

For issue #523

Checklist:

Fixes validate being called with undefined this variable scope.

Closes #523

GitCop commented 7 years ago

There were the following issues with your Pull Request

Guidelines are available at https://github.com/formly-js/angular-formly/blob/master/CONTRIBUTING.md


This message was auto-generated by https://gitcop.com

codecov-io commented 7 years ago

Current coverage is 95.93% (diff: 100%)

Merging #728 into master will not change coverage

@@             master       #728   diff @@
==========================================
  Files            17         17          
  Lines          1181       1181          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           1133       1133          
  Misses           48         48          
  Partials          0          0          

Powered by Codecov. Last update fc45fb3...ed1fcfc

kentcdodds commented 7 years ago

Could someone from @angular-formly-collaborators review and merge this?

kentcdodds commented 7 years ago

Sorry, bad @ mention. Someone from @formly-js/angular-formly-collaborators please review and merge this. Thanks.