I need five independent fields based on the actual price and offer i need to find final price This is my sample html code
addproduct.html
<tbody ng-repeat="a in [1,2,3,4,5]">
<tr>
<th scope="row">{{a}}</th>
<td><input type="text" class="form-control" placeholder="0" style="width:70%; line-height:1.5" ng-model="product.pModel"></td>
<td><input type="text" class="form-control" placeholder="0" style="width:70%; line-height:1.5" ng-model="product.actualPrice" max="2" limit-decimal></td>
<td><input type="text" class="form-control" placeholder="0" style="width:50%; line-height:1.5" ng-model="product.offer" numbers-only></td>
<td>
<label class="checkbox-inline" ng-init="data.check=true">
<input type="checkbox" id="inlineCheckbox" value="option" ng-change="product.availablity = data.check ? '' : 0" ng-model="data.check"> Unlimited
</label>
</td>
<td><input class="form-control" type="text" id="availablity" name="availablity" ng-disabled="data.check0" ng-model="product.availablity" ></td>
<td class="text-center"> <b ng-model="finalPrice" ng-bind="finalPrice=product.actualPrice-(product.actualPrice*product.offer/100)"></b></td>
</tr>
</tbody>
How can i save data in json format using angularjs
When I save the submit button I need the output as
script.json
product : [
{
"pModel" : "50gm",
"actualPrice" : "250",
"offer" : 0,
"availablity" : "0"
},
{
"pModel" : "50gm",
"actualPrice" : "250",
"offer" : 0,
"availablity" : "0"
}
.....upto 5 fields
]
In here when I am entering any one of the field it will affect entire field