Skip to content

Commit 0b61296

Browse files
feat: on push strategy for tag component (#3190)
1 parent 9708bfd commit 0b61296

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/tag/tag-filter.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
EventEmitter,
55
HostBinding,
66
Input,
7-
TemplateRef
7+
ChangeDetectionStrategy
88
} from "@angular/core";
99
import { Tag } from "./tag.component";
1010

@@ -28,7 +28,8 @@ import { Tag } from "./tag.component";
2828
<svg cdsIcon="close" size="16"></svg>
2929
</button>
3030
}
31-
`
31+
`,
32+
changeDetection: ChangeDetectionStrategy.OnPush
3233
})
3334
export class TagFilter extends Tag {
3435
@Input() closeButtonLabel = "Clear Filter";

src/tag/tag.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {
22
Component,
33
Input,
4-
HostBinding
4+
HostBinding,
5+
ChangeDetectionStrategy
56
} from "@angular/core";
67

78
/**
@@ -38,7 +39,8 @@ export type TagType = "red" |
3839
<ng-content />
3940
</span>
4041
}
41-
`
42+
`,
43+
changeDetection: ChangeDetectionStrategy.OnPush
4244
})
4345
export class Tag {
4446
/**

0 commit comments

Comments
 (0)