Skip to content

Commit 9708bfd

Browse files
feat: convert input-label components to use OnPush change detection strategy (#3182)
1 parent 13074c9 commit 9708bfd

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/input/password-input-label.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
TemplateRef,
88
ViewChild,
99
ChangeDetectorRef,
10-
ContentChild
10+
ContentChild,
11+
ChangeDetectionStrategy
1112
} from "@angular/core";
1213
import { PasswordInput } from "./password.directive";
1314
import { BaseIconButton } from "carbon-components-angular/button";
@@ -149,7 +150,8 @@ import { BaseIconButton } from "carbon-components-angular/button";
149150
}
150151
</div>
151152
}
152-
`
153+
`,
154+
changeDetection: ChangeDetectionStrategy.OnPush
153155
})
154156
/**
155157
* Represents the Password Input Label Component.

src/input/text-input-label.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
AfterContentInit,
33
AfterViewInit,
4+
ChangeDetectionStrategy,
45
ChangeDetectorRef,
56
Component,
67
ElementRef,
@@ -124,7 +125,8 @@ import {
124125
}
125126
</div>
126127
}
127-
`
128+
`,
129+
changeDetection: ChangeDetectionStrategy.OnPush
128130
})
129131
export class TextInputLabelComponent implements AfterViewInit, AfterContentInit {
130132
/**

src/input/textarea-label.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
TemplateRef,
88
ViewChild,
99
ContentChild,
10-
ChangeDetectorRef
10+
ChangeDetectorRef,
11+
ChangeDetectionStrategy
1112
} from "@angular/core";
1213

1314
import { TextArea } from "./text-area.directive";
@@ -137,7 +138,8 @@ import { TextArea } from "./text-area.directive";
137138
}
138139
}
139140
}
140-
`
141+
`,
142+
changeDetection: ChangeDetectionStrategy.OnPush
141143
})
142144
export class TextareaLabelComponent implements AfterViewInit {
143145
/**

0 commit comments

Comments
 (0)