Skip to content

Commit 8786df9

Browse files
committed
refactor: extract selector constants
1 parent 0a54d25 commit 8786df9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

apps/this-is-learning/src/app/hello/hello.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import {
44
ViewEncapsulation,
55
} from '@angular/core';
66

7+
const selector = 'til-hello';
8+
79
@Component({
810
changeDetection: ChangeDetectionStrategy.OnPush,
911
encapsulation: ViewEncapsulation.None,
10-
selector: 'til-hello',
12+
selector,
1113
styles: [
1214
`
13-
til-hello {
15+
${selector} {
1416
display: block;
1517
}
1618
`,

libs/publications/feature-this-is-angular/src/lib/shell/shell.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import {
55
} from '@angular/core';
66
import { ActivatedRoute } from '@angular/router';
77

8+
const selector = 'til-this-is-angular-shell';
89
@Component({
910
changeDetection: ChangeDetectionStrategy.OnPush,
1011
encapsulation: ViewEncapsulation.None,
11-
selector: 'til-this-is-angular-shell',
12+
selector,
1213
styles: [
1314
`
14-
til-this-is-angular-shell {
15+
${selector} {
1516
display: block;
1617
}
1718
`,

0 commit comments

Comments
 (0)