Which CSS selector to use when applying a style to any component having an event binding?
<button (click)="doSomthing()">click me</button>
Something like this is not working.
[(click)]{
color: red;
}
Which CSS selector to use when applying a style to any component having an event binding?
<button (click)="doSomthing()">click me</button>
Something like this is not working.
[(click)]{
color: red;
}
In the rendered HTML, there is no attribute that corresponds to the Angular (click)
event on the button. You can see that by inspecting the markup with the F12 tool in your browser. Therefore, you cannot use that event binding as a CSS selector. You would have to use another selector to identify the button (id, class, another attribute, etc.).