login.component.html
<form (ngSubmit)="submitLogin()" #loginForm="ngForm">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="email" name="email" [(ngModel)]="form.email" [ngModelOptions]="{standalone: true}" required>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="password" name="password" [(ngModel)]="form.password" [ngModelOptions]="{standalone: true}" required>
</div>
<button type="submit" class="btn btn-primary" [disabled]="!loginForm.form.valid">Submit</button>
</form>
I am new in angular and I trying to disabled submit button until form input field is blank but here it showing enable but if I code like "loginForm.form.valid" then the submit button show disabled after put ! like "!loginForm.form.valid" then again it show enable submit button. So, How can I fix this issue? Please help me.
Thank You