之前我问过这个问题,但我仍然无法解决这个问题。有人可以请帮助。
我有一个过滤功能:
$scope.filterByTimestamp = function(filter){
console.log("blah");
return $scope.timestamp = new Date($scope.startDate).getTime();
}
"等等"在控制台中登录两次,并记录11374次。我像这样过滤我的Html视图:
<label class="item item-input">
<span class="input-label">Date</span>
<input type="date" ng-model="startDate" >
</label>
</div>
<div ng-model="timestamphope">{{timestamp}} </div>
<div ng-repeat="x in result ">
<div ng-repeat="y in x.rates | filterByTimestamp ">
{{y[0]}}
</div>
</div>
视图不会改变。我想只显示等于函数$ scope.timestamp = new Date($ scope.startDate).getTime();
的结果