vinayakkyadav
vinayakkyadav

Reputation: 59

How to assign value to input type file for edit form in angular js

I am having problem in assigning the value to form which in Angular JS, On click of the edit i am assigning values to form fields using the ngModel. I am getting the error in chrome for input type file

enter image description here

could you help me in finding the solution for this.

Upvotes: 0

Views: 499

Answers (1)

vinayakkyadav
vinayakkyadav

Reputation: 59

This is my HTML Code, binding with ng-model

 <div class="col-xs-4">
                            <div class="height:100%;">
                                <input type="file"  ng-model="addmaterials.vray_mat_file" name="material_vray_mat"  id="material_vray_mat" class="hidden"  required="" ng-model-options="{ allowInvalid: true }"/>            
                                <label class="mat_file" for="material_vray_mat" >Upload Mat file</label>
                            </div>
                    </div>
                    <div class="col-xs-4">
                        <div class="height:100%;">
                            <input type="file"     required=""  ng-model="addmaterials.vray_sbsar_file" name="material_vray_sbsar" id="material_vray_sbsar" ng-disabled="!addmaterials.createdWithSubstance"  class="hidden"  >            
                            <label class="mat_file" for="material_vray_sbsar" >Upload Sbsar</label>
                        </div>
                    </div>
                    <div class="col-xs-4">
                            <div class="height:100%;">
                                <input type="file" required=""  onchange="angular.element(this).scope().setVrayPrevImg(this)"  ng-model="addmaterials.vray_prev_img" name="material_vray_prev"     id="material_vray_prev" class="hidden"  >            
                                <label class="mat_file" for="material_vray_prev" >Upload Preview</label>
                            </div>
                    </div>

Upvotes: 1

Related Questions