in $scope.reviews = {};
I put an array. Where I need I call something in the spirit:
<div ng-repeat="review in reviews"> {{review.id}} {{review.name}} {{review.date}} </div>
How can I do a specific operation with a specific column of this array? For example, format the date. I want to do this not on the side of the template, but in the controller.
angular.forEach($scope.reviews,function(review){})
. - Stepan Kasyanenko$scope.reviews
in the comments.angular.forEach
works with an array. You need to do this:angular.forEach($scope.reviews, function(review) { review.updated_at = review.updated_at.split(" ",3); });
- Stepan Kasyanenko