数组更新后角度过滤器无法正常工作

时间:2015-09-18 12:59:15

标签: javascript arrays angularjs ionic-framework angular-filters

我正在开发一个Angular App,它从Web服务器获取一些数据作为JSON,并在使用ng-repeat的列表中显示。现在,动态地,我想向ng-repeat使用的数组添加更多数据。我使用另一个函数获取更多数据并使用

将其附加到数组中
$scope.MyArrayName.push.apply($scope.MyArrayName, newDataArray)

但之后过滤器停止工作。过滤器如下。

<a class="item item-thumbnail-left item-text-wrap" href="#/main/postDetail/{{post.id}}" ng-repeat="post in MyArrayName | filter: {title:searchText}">

其中searchText是类型为text的输入,其中ng-model =&#34; searchText&#34;。

请注意,在向阵列添加新数据之前,过滤器工作正常。但之后就停止了。

非常感谢任何帮助。

0 个答案:

没有答案
相关问题