1This question could be solved with a combination of these two answers: https://stackoverflow.com/a/43493648/6294072 and https://stackoverflow.com/a/47670892/6294072
2
3So first of all, you would need a custom validator for checking the passwords, that could look like this:
4
5checkPasswords(group: FormGroup) { // here we have the 'passwords' group
6 const password = group.get('password').value;
7 const confirmPassword = group.get('confirmPassword').value;
8
9 return password === confirmPassword ? null : { notSame: true }
10}