I am working an event page with many filters. User can filter out events by severity, description, and duration. Severity levels of events can be 'critical', 'warning', 'ok'. Can anyone show me how to count the number of filtered events with each severity?. I expect something like this
Number of Critical Events: 4
Number of Warning Event: 7
Number of Ok Event: 2
When the number of filtered events change, these numbers will change accordingly. Thank you very much.
Json
{
'severity': 'Critical',
'description': 'content1',
'duration': 1
}
{
'severity': 'Warning',
'description': 'content2',
'duration': 2
}
{
'severity': 'ok',
'description': 'content3'
'duration': 3
}
HTML
<input type='text' ng-model='search.description'>
<input type='text' ng-model='search.severity'>
<input type='text' ng-model='search.duration'>
<div ng-repeat='eventData in eventsData | filter:search:strict>
<div>eventData.severity</div>
<div>eventData.description</div>
<div>eventData.duration</div>
</div>