I'm trying to retrieve the form value in my .ts file, but I am only getting the password value and not the email. Here is the code snippet:
<div class="wrapper">
<form autocomplete="off" class="form-signin" method="post" (ngSubmit)="loginForm.form.valid && onSubmit(loginForm)" #loginForm="ngForm">
<div class="text-center mb-4">
<h1>Sign In</h1>
</div>
<div class="form-label-group">
<label>Email</label>
<input
type="email"
id="input-email"
[(ngModel)]="adminemail"
#admin_email="ngModel"
class="form-control"
placeholder="Email address"
autocomplete="email" autofocus [ngModelOptions]="{standalone: true}">
</div>
<div class="form-label-group">
<label>Password</label>
<input
type="password"
class="form-control"
placeholder="Password"
autocomplete="new-password"
name="password"
id="input-password"
[(ngModel)]="password">
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
<div>
<p>
<a routerLink='/pages'>Forgot Password</a>
</p>
</div>
</form>
</div>
The .ts file contains this .html
code where I'm using NgForm from '@angular/forms':
import { NgForm } from '@angular/forms';
...
...
onSubmit(form: NgForm) {
console.log(form.value)
}
{password: "123456"}
However, in the console log, I only see the value of the password field and not the email. Is there something I'm missing?