Skip to content

Commit 4841f88

Browse files
committed
Switch to host class metadata property
1 parent c20934f commit 4841f88

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

projects/todo-mvc/src/app/todo-list.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { CdkDrag, CdkDropList } from '@angular/cdk/drag-drop';
22
import {
33
ChangeDetectionStrategy,
44
Component,
5-
HostBinding,
65
inject,
76
} from '@angular/core';
87
import { FormControl, ReactiveFormsModule } from '@angular/forms';
@@ -15,6 +14,9 @@ import { TodoComponent } from './todo.component';
1514
changeDetection: ChangeDetectionStrategy.OnPush,
1615
imports: [ReactiveFormsModule, RxLet, TodoComponent, CdkDropList, CdkDrag],
1716
providers: [TodoService],
17+
host: {
18+
class: 'todo-app',
19+
},
1820
styles: `
1921
:host {
2022
display: block;
@@ -106,8 +108,6 @@ import { TodoComponent } from './todo.component';
106108
`
107109
})
108110
export class TodoListComponent {
109-
@HostBinding('class.todo-app') readonly todoApp = true;
110-
111111
readonly input = new FormControl('');
112112
readonly todoService = inject(TodoService);
113113
readonly resetInput = () => this.input.reset();

projects/todo-mvc/src/app/todo.component.ts

-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import {
33
ChangeDetectorRef,
44
Component,
55
ElementRef,
6-
HostBinding,
76
Input,
87
Output,
9-
ViewChild,
108
inject,
119
viewChild,
1210
} from '@angular/core';

0 commit comments

Comments
 (0)