From 8786df93c5f255aad34fd97112e0ae5fb820a2f6 Mon Sep 17 00:00:00 2001 From: Lars Gyrup Brink Nielsen Date: Thu, 19 Aug 2021 21:46:01 +0200 Subject: [PATCH] refactor: extract selector constants --- apps/this-is-learning/src/app/hello/hello.component.ts | 6 ++++-- .../src/lib/shell/shell.component.ts | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/this-is-learning/src/app/hello/hello.component.ts b/apps/this-is-learning/src/app/hello/hello.component.ts index 720ea61..9751e2b 100644 --- a/apps/this-is-learning/src/app/hello/hello.component.ts +++ b/apps/this-is-learning/src/app/hello/hello.component.ts @@ -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; } `, diff --git a/libs/publications/feature-this-is-angular/src/lib/shell/shell.component.ts b/libs/publications/feature-this-is-angular/src/lib/shell/shell.component.ts index 674f9da..c79bd23 100644 --- a/libs/publications/feature-this-is-angular/src/lib/shell/shell.component.ts +++ b/libs/publications/feature-this-is-angular/src/lib/shell/shell.component.ts @@ -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; } `,