In this code, I have an error that says “Cannot read properties of undefined (reading ‘indexOf’)”
lowPassword(control: FormControl): {
[lowLevelPassword: string]: boolean;
} {
if (this.invalidPassword.indexOf(control.value) != -1) {
return {
lowLevelPassword: true,
};
}
return null;
}