DEV/JS

[Angular] host에 class 넣는 방법

zineeworld 2021. 6. 15. 19:38
@Component({
    selector: 'admin-lnb',
    templateUrl: './admin-lnb.component.html',
    styleUrls: ['./admin-lnb.component.scss'],
    host: { class: 'block' } // 이렇게 하면 됩니다.
})

 

 

https://stackoverflow.com/questions/34641281/how-to-add-class-to-host-element

 

How to add "class" to host element?

I dont't know how to add to my component a dynamic class attribute but inside the template html (component.html). The only solution I found is to modify the it...

stackoverflow.com

반응형