I want to validate input type=file
field using Angular.js. Here is my code:
<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"/>
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. How can I do this?