Farata / angular2typescript

Code samples from the book Angular 2 Development with TypeScript
MIT License
440 stars 269 forks source link

Remove extraneous argument for passwordsGroup FormGroup #20

Closed rwaskiewicz closed 7 years ago

rwaskiewicz commented 7 years ago

When running Ch 7's 09_reactive-with-validation.ts the following is shown in the developer console:

EXCEPTION: Error in :0:0 caused by: this.validator is not a function
ErrorHandler.handleError @ :62683/node_modules/@angular/core/bundles/core.umd.min.js:31

The root cause appears to be in the constructor for passwordsGroup, where an object literal is used as the second argument for the constructor, and equalValidator is used as the async validator argument. Removing the second argument (making equalValidator the second/synchronous validator argument) resolves this issue

yfain commented 7 years ago

Thank you, Ryan!