Since Angular 19, the use of the host
property is recommended (rather than @HostBinding
).
So you can do:
@Component({
selector: 'app-foo',
template: '...',
host: {
'[class.some-class]': 'someClass()',
},
})
export class FooComponent {
someClass = computed(() => ...); // works well with signals 💪
}