<form name="form" (ngSubmit)="f.form.valid && emitSubmit(f.form.value)" #f="ngForm" novalidate> <div class="form-group"> <label for="email">Email address</label> <input type="email" id="email" class="form-control" name="email" [(ngModel)]="model.email" placeholder="Enter email" required autofocus> <small class="form-text text-muted">We'll never share your email with anyone else.</small> </div> <label for="password">Password</label> <div class="input-group mb-3"> <input [type]="showPassword ? 'text' : 'password'" id="password" class="form-control" placeholder="Password" name="password" [(ngModel)]="model.password" aria-label="Password" required> <div class="input-group-append"> <button class="btn btn-outline-secondary" type="button" id="button-addon2" (click)="showPassword = !showPassword"> <div *ngIf="!showPassword"><span class="fas fa-fw fa-eye-slash"></span></div> <div *ngIf="showPassword"><span class="fas fa-fw fa-eye"></span></div> </button> </div> </div> <div class="form-group"> <button type="submit" class="btn btn-success" [disabled]="!f.form.valid || f.form.pristine">Sign In</button> </div> </form>