I need one help.I want to validate input type=file
field using Angular.js.I am explaining my code below.
<div class="input-group bmargindiv1 col-md-12">
<span class="input-group-addon ndrftextwidth text-right" style="width:180px">Upload Image :</span>
<input type="file" class="filestyle form-control" data-size="lg" name="bannerimage" id="bannerimage" ngf-select ng-model="file" ngf-pattern="'image/*'" accept="image/*" ngf-max-size="20MB" ngf-min-height="100" ngf-resize="{width: 100, height: 100}" >
</div>
<input type="button" class="btn btn-success" ng-click="addProductInfoData();" id="addProfileData" ng-value="buttonName"/>
Here i am using angular.js ngFileUpload
module.My requirement is when user will forget to select image and click on Add button one alert message will notify user to select image. Please help me to do this.
if (form.file.$valid && $scope.file)
? – Rayon Dec 4 '15 at 11:54console.log('valid',billdata.bannerimage.$invalid);
but it gave me false when file input is blank. – satya Dec 4 '15 at 12:01