I am trying to add images in my form in angular and in run time i get the js error:
core.mjs:10592 ERROR Error: Cannot find control with name: 'Image1'
at _throwError (forms.mjs:3150:11)
at setUpControl (forms.mjs:2933:13)
at FormGroupDirective.addControl (forms.mjs:4782:9)
at FormControlName._setUpControl (forms.mjs:5370:43)
at FormControlName.ngOnChanges (forms.mjs:5315:18)
at FormControlName.rememberChangeHistoryAndInvokeOnChangesHook (core.mjs:2928:14)
at callHookInternal (core.mjs:3920:14)
at callHook (core.mjs:3951:9)
at callHooks (core.mjs:3902:17)
at executeInitAndCheckHooks (core.mjs:3852:9)
<div class="form-group col-12 photo-control" style="text-align: center;">
<strong style="color: orangered;">Main Image (Required)</strong><br/>
<div class="row" style="margin-bottom: 15px;">
<div class="col-md-3">
<input type="text" formControlName="Image1">
<input type="file" #file placeholder="Choose file" (change)="uploadFile(file.files)"
style="display: none;">
<button type="button" class="btn btn-success" (click)="file.click()">Upload File</button>
</div>
<div class="col-md-4">
<span class="upload" *ngIf="progress > 0">
{{progress}}%
</span>
<span class="upload" *ngIf="message">
{{message}}
</span>
</div>
</div>
</div>