我的问题是我想延迟angularjs中的ng-repeat结果。我的延迟过滤器代码如下。使用过滤器延迟ng-repeat结果
<ul>
<li ng-repeat="phone in phones | filter:delay_filter">
<span>{{phone.name}}</span>
</li>
</ul>
<script>
var phonecatApp = angular.module('phonecatApp', ['ngMessages']);
phonecatApp.controller('PhoneListCtrl', function ($scope, $http, $scope) {
$scope.delay_filter=function(item){
alert(++$c);
x=setTimeout($scope.trf(),2200);
return item;
};};)
</script>
但这不起作用。搜索提供了即时结果。 我没有在html中编写控制器,我知道这一点。在我的代码在那里。那不是问题。请帮我解决这个问题
看看这是这样的http://stackoverflow.com/questions/18238227/delay-an-angular-js-http-service – Jax
你试图实现与延迟?如果这是为了视觉上的延迟,ng-animate有一个错误,你可以使用这样的东西。 – ajmajmajma
您是否需要延迟ng-repeat的显示,或者是否需要延迟手机上的某种搜索/过滤器? –