문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판 | |||
| angular:directive [2023/05/06 04:10] – taekgu | angular:directive [2025/04/15 10:05] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| + | ====== Directive ====== | ||
| + | <code javascript> | ||
| + | @Directive({ | ||
| + | selector: " | ||
| + | }) | ||
| + | export class KeyupDirective { | ||
| + | @HostListener(" | ||
| + | console.log(event); | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Test ==== | ||
| + | |||
| + | <code javascript directive.spec.ts> | ||
| + | describe(' | ||
| + | // let component: MaroBaseComponent; | ||
| + | let fixture : ComponentFixture< | ||
| + | it(' | ||
| + | const directive = fixture.componentInstance.gdComponent; | ||
| + | expect(directive).toBeTruthy(); | ||
| + | }); | ||
| + | }); | ||
| + | </ | ||