I am trying to get data in angular js controller using angularjs form submission ng-submit="method"
Normally all data I can see in controller using alert()
. Now the problem is if I use ng-if
condition inside of angular form then this specific field value show undefined
. How can I solve this?
<div class="row" id="BarcodeDiv">
<span ng-model="br" ng-init="br=1" id="br" style="display:none;"><i class="fa fa-etsy" aria-hidden="true"></i></span>
<span ng-if="br==2">
<div class="col-sm-6">
<label>Serial Number</label> <span ng-click="barCodeChanger()" style="cursor:pointer;"><i class="icon-rotate-cw3"></i></i></span>
<input type="text" name="Barcode" ng-model="Barcode1" class="form-control" placeholder="123">
</div>
<div class="col-sm-3">
<label>From</label>
<input type="text" name="StartFrom" ng-model="StartFrom" id="StartFrom" class="form-control" placeholder="4" style="padding:5px;">
</div>
<div class="col-sm-3">
<label>To</label>
<input type="text" name="ToEnd" ng-model="ToEnd" id="ToEnd" class="form-control" placeholder="9" style="padding:5px;">
</div>
</span>
<span ng-if="br==1">
<div class="col-sm-12">
<label>Serial Number</label> <span ng-click="barCodeChanger()" style="cursor:pointer;"><i class="icon-rotate-ccw3"></i></span>
<input type="text" name="Barcode" ng-model="Barcode" class="form-control" placeholder="123">
</div>
</span>
</div>