Привет и добро пожаловать на Stackoverflow! Попробуйте переключиться между type = "password" и type = "text" на основе значения флажка.
Добавьте #showPassword к вашему входу флажка, например:
<input #showPassword type="checkbox" class="form-check-input" [disabled]="pwd.invalid">
Тогдав поле вашего пароля:
<input type="showPassword.checked ? 'text' : 'password'" .... />
РЕДАКТИРОВАТЬ (если вы еще не решили его и для других):
component.ts
// show/hide boolean variable
showPassword: boolean;
constructor() {
// init value in constructor
this.showPassword = false;
}
// click event, show/hide based on checkbox value
showHidePassword(e) {
this.showPassword = e.target.checked;
}
component.html
<input [type]="showPassword ? 'text' : 'password'" />
<input type="checkbox" (change)="showHidePassword($event)" > toggle view