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: {
You can do the following:
import {Component} from "@angular/core"
@Component({
selector: "[textbox]",
host: {"class": "first-class secondClass ThirdClass AnYClaSs"},
template: ...
})
export class MyComponent { }
Which is imo way more straightforward than introducing a variable.
Should work in Angular2 rc5, rc6, rc7, final. May work in earlier versions, but didnt try it.