找不到如何解决指令 'ngChange' 所需的控制器 'ngModel'!例外?

How to resolve Controller 'ngModel', required by directive 'ngChange', can't be found! exception?

我知道上述问题有很多答案,但差别不大 'directive' 而不是 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)">