From 3e094d0490ee32bea54fc9654852b85d5371f04a Mon Sep 17 00:00:00 2001 From: HarveyMac Date: Sat, 5 Nov 2022 15:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8angular=20=E5=85=A7=E9=83=A8p?= =?UTF-8?q?ipe=EF=BC=8C=E5=81=9A=E9=A1=AF=E7=A4=BA=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E7=9A=84=E6=94=B9=E8=AE=8A=20=E5=8F=AA?= =?UTF-8?q?=E6=94=B9=E8=AE=8A=E9=A1=AF=E7=A4=BA=E6=96=87=E5=AD=97=EF=BC=8C?= =?UTF-8?q?=E8=80=8C=E4=B8=8D=E6=94=B9=E8=AE=8A=E6=96=87=E5=AD=97=E5=85=A7?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.component.html | 5 +++-- src/app/app.module.ts | 3 +-- src/app/over-highlight.directive.ts | 19 ------------------- 3 files changed, 4 insertions(+), 23 deletions(-) delete mode 100644 src/app/over-highlight.directive.ts diff --git a/src/app/app.component.html b/src/app/app.component.html index 75a2411..05ee3d7 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,2 +1,3 @@ -

當游標移到這裡,會改變文字顏色

-

這裡套上了就不會改變顏色

+
Upper Case: {{ 'angular' | uppercase }}
+
lower Case: {{ 'angular' | lowercase }}
+
Title Case: {{ 'angular' | titlecase }}
diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2b41a28..93c6719 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -3,11 +3,10 @@ import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; -import { OverHighlightDirective } from './over-highlight.directive'; @NgModule({ imports: [ BrowserModule, FormsModule ], - declarations: [ AppComponent, OverHighlightDirective ], + declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } diff --git a/src/app/over-highlight.directive.ts b/src/app/over-highlight.directive.ts deleted file mode 100644 index d80e3f4..0000000 --- a/src/app/over-highlight.directive.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Directive, HostBinding, HostListener } from '@angular/core'; - -@Directive({ - selector: '[appOverHighlight]', -}) -export class OverHighlightDirective { - @HostBinding('class.overing') - isOvering = false; - - @HostListener('mouseover') - onMouseOver() { - this.isOvering = true; - } - - @HostListener('mouseout') - onMouseOut() { - this.isOvering = false; - } -}