I know that in Angular2 I can add a class \'red\' to a component\'s selector element by doing this:
@Component({ selector: \'selector-el\', host: {
If you like to change it from outside you can combine @HostBinding and @Input():
@HostBinding
@Input()
@Component({ selector: 'my-component', template: `` }) export class MyComponent { @HostBinding('class.your-class') @Input() isSelected: boolean; }