0

I'm trying to do an edit operation. When clicking on the particular item I want to edit I'm getting the data for the text inputs but I'm not getting the data for input type ="file". It shows as no file chosen.

component.html

<form name="form" (ngSubmit)="editLifeCycleSubmitHandler(editForm.value)" #editForm="ngForm" novalidate>

      <input type="hidden" name="id" [(ngModel)]="editObj.id" #id="ngModel">

      <div class="form-group">
        <label for="lifecycle">Lifecycle</label>
        <input type="text" class="form-control" name="lifecycle" [(ngModel)]="editObj.lifecycle" #lifecycle="ngModel"
          required />
          <span class="help-block" *ngIf="lifecycle.invalid  && lifecycle.touched">
              *Lifecycle is required
          </span> 
      </div>

      <div class="upload-btn" title="upload image">
          <p>Flowdown Image</p>
          <input class="chose-file fa fa-cloud-upload click_upload" type="file" name="flow_down_image" [(ngModel)]="editObj.flow_down_image" #flow_down_image="ngModel"
            (change)="editImageUpload($event)" accept="image/*" aria-hidden="true" >
            {{editObj.flow_down_image}}
          <br><br>
      </div>


      <div class="form-group" id="esuccess-form">
        <button class="btn btn-primary ang_login_btn btn-block"[disabled]="editForm.invalid">Submit</button>
      </div>

    </form>

enter image description here

enter image description here

Jijo Robin
  • 365
  • 9
  • 27

1 Answers1

0

the html seems to be OK, the value that updates the input is the part:

< .... [(ngModel)]="editObj.id" ...>

We need more info like the typescript code.

By the way you can upload your code to stackblitz and we can try to help you better.

Gonzalo Lorieto
  • 635
  • 6
  • 24
Alberto AM
  • 310
  • 2
  • 12