角度:过滤对象数组时出现 [filter:notarray] 错误



>我有一个对象数组格式的学生数组。该列表由 Angular $http Service 返回。

当我使用angular.isArray进行测试时,它被确认为一个数组。

使用 ng-repeat="student in students|filter:searchText" 的过滤器,我得到一个 [filter:notarray] 错误。过滤器正在工作。

我做错了什么?

对不起。从 $scope.students={} 开始弄乱了我的数组;在我的控制器中,然后;$scope.学生=数据;$http通话后。

删除 $scope.students={};修复了错误。

最新更新