Let's say I have the following directive :
@Directive({
selector: 'button[my-button], button[my-button-outline]',
})
export class ButtonComponent {
@Input() color = 'primary';
@HostBinding('class')
public get colorClass(): string {
return `btn btn-${this.color}`;
}
}
I would like to assign a different class depending on if I used my-button
or my-button-outline
Is this behavior possible in Angular 12 ?
There is a similar question, but without solution : Multiple directive selectors - find which selector was used in template