File tree Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Expand file tree Collapse file tree 4 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 24
24
</ span >
25
25
</ div >
26
26
< div style ="display:inline-block ">
27
- < todo-tags (tagSelected) ="filterOnTag($event) " [tags] ="tags "> </ todo-tags >
27
+ < todo-tags (tagSelected) ="filterOnTag($event) " [tags] ="tags " [selectedTag] =" tagFilter " > </ todo-tags >
28
28
</ div >
29
29
</ div >
30
30
Original file line number Diff line number Diff line change @@ -5,14 +5,15 @@ import {CORE_DIRECTIVES} from 'angular2/common';
5
5
selector : 'todo-tag' ,
6
6
template : `
7
7
<div (click)="tagClick()" style="display:inline-block; cursor:pointer; border-radius:5px;
8
- color:gold; background-color:black; padding:5px">{{tag}}</div>
8
+ color:gold; background-color:black; padding:5px">{{tag}} - {{isSelected}} </div>
9
9
` ,
10
10
directives : [ CORE_DIRECTIVES ]
11
11
} )
12
12
13
13
export class TodoTag {
14
14
15
15
@Input ( ) tag : string ;
16
+ @Input ( ) isSelected : boolean ;
16
17
@Output ( ) tagClicked : EventEmitter < string > = new EventEmitter < string > ( ) ;
17
18
18
19
ngOnInit ( ) {
Original file line number Diff line number Diff line change 1
1
< div style ="display:inline-block ">
2
- < todo-tag (tagClicked) ="tagClicked($event) " [tag] ="t " *ngFor ="#t of tags | async "> </ todo-tag >
2
+ < todo-tag (tagClicked) ="tagClicked($event) " [tag] ="t " [isSelected] =" t === selectedTag " *ngFor ="#t of tags | async "> </ todo-tag >
3
3
</ div >
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {TodoTag} from './TodoTag';
13
13
export class TodoTags {
14
14
15
15
@Input ( ) tags : Observable < string [ ] > ;
16
+ @Input ( ) selectedTag : string ;
16
17
@Output ( ) tagSelected : EventEmitter < string > = new EventEmitter < string > ( ) ;
17
18
18
19
tagClicked ( tag :string ) {
You can’t perform that action at this time.
0 commit comments