我需要添加两个输入字段的值并显示在第三个输入字段中。将输入类型作为数字确实很简单,但不幸的是,这在IE中不起作用。它在铬合金中效果很好。你能帮我解决一下如何在IE中做到这一点,以便它能同时支持。
<tr>
<th>Business</th>
<th><input type="number" class="col-sm-12" ng-model="input1"/></th>
<th><input type="number" class="col-sm-12" ng-model="input2"/></th>
<th style="background-color:beige"><input type="number" class="col-sm-12" value="{{input1+input2}}" readonly /></th>
<th><input type="number" class="col-sm-12" ng-model="input3"/></th>
</tr>
答案 0 :(得分:0)
此方法ng-value="input1+input2"
适用于IE11
var app = angular.module('app', []);
app.controller('AppController', function($scope){})
&#13;
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div data-ng-app="app">
<table data-ng-controller="AppController">
<tr>
<th>Business</th>
<th><input type="number" class="col-sm-12" ng-model="input1"/></th>
<th><input type="number" class="col-sm-12" ng-model="input2"/></th>
<th style="background-color:beige"><input type="number" class="col-sm-12" ng-value="input1+input2" readonly /></th>
<th><input type="number" class="col-sm-12" ng-model="input3"/></th>
</tr>
</table>
</div>
&#13;