Is there a way to display only the current user's amount without the | currency:"£"
filter?
(function() {
var app = angular.module('myApp', []);
app.controller('roomController', function($scope) {
$scope.users = [{
id: 1,
firstname: 'member',
spent: 206.98
}, {
id: 2,
firstname: 'member',
spent: 12.23
}, {
id: 3,
firstname: 'member',
spent: 302.12
}, {
id: 4,
firstname: 'member',
spent: 198.21
}, {
id: 5,
firstname: 'member',
spent: 85.85
}];
$scope.currentuser = 4;
});
})();
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp">
<div ng-controller="roomController">
<h2 ng-repeat="user in users"><i class="fa fa-gbp"></i> {{ user.id === currentuser ? user.spent : '' | currency:"£"}}</h2>
</div>
</div>