Skip to content

Commit db94a05

Browse files
authored
Merge pull request #541 from Pablodotnet/master
Added possibility to give action to the X button on Filter Tag
2 parents 036fc0e + 6c20b36 commit db94a05

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/tag/tag-filter.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
import { Component, HostBinding } from "@angular/core";
1+
import {
2+
Component,
3+
Output,
4+
EventEmitter,
5+
HostBinding
6+
} from "@angular/core";
27
import { Tag } from "./tag.component";
38

49
@Component({
510
selector: "ibm-tag-filter",
611
template: `
712
<ng-content></ng-content>
813
<svg
14+
(click)="close.emit()"
915
focusable="false"
1016
preserveAspectRatio="xMidYMid meet"
1117
style="will-change: transform;"
@@ -20,6 +26,11 @@ import { Tag } from "./tag.component";
2026
`
2127
})
2228
export class TagFilter extends Tag {
29+
/**
30+
* Function for close/delete the tag
31+
*/
32+
@Output() close = new EventEmitter<any>();
33+
2334
@HostBinding("attr.class") get attrClass() {
2435
return `bx--tag bx--tag--filter bx--tag--${this.type} ${this.class}`;
2536
}

0 commit comments

Comments
 (0)