我有点被困在这里.我有一个应用程序使用bootstrap模式与几个文本框,其中包含来自服务器的值.当我第一次打开模态并从文本框中删除项目时更改事件触发.清除所有字段后,我关闭了模态.当我再次打开模态时,它会填充新值,但是当我从文本框中删除项目时,不会触发ng-change事件.
但是在这里我发现了一个更奇怪的事情,只有在文本框中有一个项目时才会出现上述问题.
<tr> <td> <input only-numeric class="floatLeft" name="scoreSample" type="text" ng-model="scoreSample" id="scoreSample" ng-change="sampleMethod()" ng-model-onblur> </td> <td> <input only-numeric class=" floatLeft" name="errorSample" type="text" ng-model="errorSample" id="errorSample" ng-change="sampleMethod()" ng-model-onblur> </td> </tr>
AngularJS代码:
$scope.sampleMethod = function () { alert("Coming here"); }
提前致谢.