0
通過使用angularjs IM乘以兩個值,但是當我上添加按鈕,點擊它應顯示婁文本框狀如何在div下插入記錄?
price 10 qty 2 total 20 --->Add>
Price qty Total
10 2 20
HTML代碼
<div class="row">
<div ng-controller="Supercntrl">
<div class="form-inline" id="Mom">
Price <input type="text" ng-model="price" class="form-control" />
quentity <input type="text" ng-model="Quantity" class="form-control" ng-change="Claci()" />
Total <input type="text" ng-model="Total" class="form-control" />
<input type="button" class="btn btn-sm btn-success" value="Add" ng-click="AddDetails()" />
</div>
<div >
//Display Insered Record
</div>
</div>
</div>
Controller.Js
$scope.Claci = function() {
if ($scope.price != null && $scope.Quantity != null) {
$scope.Total = $scope.price * $scope.Quantity
}
}
請提出e我如何顯示打好值怒吼出它的