create chart item state to toggle filter selection
This commit is contained in:
@@ -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>: </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() { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user