Skip to content

Commit

Permalink
refactor: extract selector constants
Browse files Browse the repository at this point in the history
  • Loading branch information
LayZeeDK committed Aug 19, 2021
1 parent 0a54d25 commit 8786df9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/this-is-learning/src/app/hello/hello.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import {
ViewEncapsulation,
} from '@angular/core';

const selector = 'til-hello';

@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'til-hello',
selector,
styles: [
`
til-hello {
${selector} {
display: block;
}
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import {
} from '@angular/core';
import { ActivatedRoute } from '@angular/router';

const selector = 'til-this-is-angular-shell';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
selector: 'til-this-is-angular-shell',
selector,
styles: [
`
til-this-is-angular-shell {
${selector} {
display: block;
}
`,
Expand Down

0 comments on commit 8786df9

Please sign in to comment.