create chart item state to toggle filter selection

This commit is contained in:
Jesse Lucas
2020-04-03 09:20:27 -05:00
parent 9907523321
commit bf062db83f
8 changed files with 61 additions and 24 deletions
@@ -1,4 +1,4 @@
<div fxLayout="row" fxLayoutAlign="space-between start" class="item">
<div fxLayout="row" fxLayoutAlign="space-between start" [ngClass]="(_selected)?'item selected':'item'">
<div><a href="#">{{state}}</a>: &nbsp;</div>
<div>{{count}}</div>
</div>
@@ -1,3 +1,13 @@
.item {
cursor: pointer;
padding: 3px;
border-radius: 4px;
}
.selected {
background-color: #DDDDDD;
}
.selected a {
color: #000000;
text-decoration: none;
}
@@ -8,6 +8,12 @@ import { Component, Input } from '@angular/core';
export class ChartItemComponent {
@Input() state: string;
@Input() count: number;
@Input('selected')
set selected(s: boolean) {
this._selected = s;
}
_selected: boolean = true;
constructor() { }
}