我知道对于上述问题有很多答案,只是“指令”而不是 ngChange。我使用的是 1.7.2 版本。 这是我的代码
<select class="full-width" id="searchWithSavedFilter" ng-modal="searchWithSavedFilter" ng-change="test(searchWithSavedFilter)">
<option ng-repeat="p in SavedFilters" value="{{p.Id}}">{{p.Name}}</option>
</select>
angularjs引用代码为
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.2/angular.min.js"></script>
最佳答案
如错误所述,您需要 ng-model
而不是 ng-modal
<select class="full-width" id="searchWithSavedFilter" ng-model="searchWithSavedFilter" ng-change="test(searchWithSavedFilter)">
关于javascript - 如何解决指令 'ngModel' 所需的 Controller 'ngChange' 找不到!异常(exception)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52578319/