FormControl validator always invalid
问题 Following my previous question, I'm trying to create a custom validator that allow the users to type only specific values in an input of text. app.component.ts: export class AppComponent implements OnInit { myForm: FormGroup; allowedValuesArray = ['Foo', 'Boo']; ngOnInit() { this.myForm = new FormGroup({ 'foo': new FormControl(null, [this.allowedValues.bind(this)]) }); } allowedValues(control: FormControl): {[s: string]: boolean} { if (this.allowedValuesArray.indexOf(control.value)) { return