Cannot assign a value to a reference or variable!
<form class="form-horizontal" (ngSubmit)="login(loginForm.value)" role="form" #loginForm="ngForm">
<div class="form-group">
<label for="username"></label>
<input class="form-control" required name="username" id="username" type="textbox" placeholder="Email"
[(ngModel)]="name" #username="ngModel">
<div *ngIf="username.invalid && (username.dirty || username.touched)" class="alert alert-danger">
<div *ngIf="username.errors.required">
Name is required.
</div>
</div>
</div>
<div class="form-group">
<label for="password"></label>
<input class="form-control" required name="password" id="password" [(ngModel)]="password" type="password"
placeholder="Password" #passWord="ngModel">
<div *ngIf="passWord.invalid && (passWord.dirty || passWord.touched)" class="alert alert-danger">
<div *ngIf="passWord.errors.required">
Name is required.
</div>
<div *ngIf="passWord.errors.minlength">
Name must be at least 4 characters long.
</div>
</div>
</div>
<div class="row" style="margin-top: 40px;">
<div class="col-sm-6">
<!-- <a class="login-link" routerlinkactive="active" ng-reflect-router-link="/register"
ng-reflect-router-link-active="active" href="/register"></a> -->
</div>
<div class="col-sm-6">
<button type="submit" class="btn btn-primary pull-right btn-login" [disabled]="!loginForm.form.valid">
Login</button>
</div>
</div>
</form>
The input #password and the variable defined in the TS file have the same name.
Change can be
Read More:
- Angular select Tag Error trying to diff ‘2’. Only arrays and iterables are allowed
- Visual Studio 2012 error C4996: ‘scanf’: This function or variable may be unsafe.
- flask init-db Error: Error: Could not locate a Flask application. Use the ‘flask –app’ option, ‘FLASK_APP’ environment variable, or a ‘wsgi.py’ or ‘app.py’ file in the current directory.
- Angular Error: No value accessor for form control with name ‘xxx’
- [Solved] Maven Error: The packaging for this project did not assign a file to the build artifact
- Sqllineage Error: OSError: [Errno 99] Cannot assign requested address
- [Solved] Opencv Call yolov3 Error: IndexError: invalid index to scalar variable
- ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib
- [Solved] At least one of these environment variable is needed to run this program
- How to Solve Vector Variable Error in sub thread
- How to Solve Angular Error: error NG8002: Can‘t bind to ‘ngModel‘ since it isn‘t a known property of ‘input‘.
- How to Solve Kotlin unresolved reference error
- [Solved] C++ error: undefined reference to `xxx‘
- FailedPreconditionError (see above for traceback): Attempting to use uninitialized value Variable
- error: undefined reference to `calculate()` [How to Solve]
- [Solved] Qt Error: undefined reference to xxxxx
- Clion new method shows undefined reference to solution
- [Solved] cortex_M3 freeRTOS Error: undefined reference to `_sbrk‘
- [Solved] Angular12 ng build Error: Index html generation failed.