In Angular 1, you could simply add
[ngClick],
[data-ng-click],
[x-ng-click] {
cursor: pointer;
}
and all tags with the ng-click
attribute would now have the pointer cursor now. How can we add the Angular 2 (click)
attribute in the same way?
This is not possible using just the name of an attribute. Angular 2 changes this template:
<div>
<h2>Hello {{name}}</h2>
<div (click)="sayhi()"></div>
</div>
to this DOM:
<div _ngcontent-xwy-0="">
<h2 _ngcontent-xwy-0="">Hello Angular2</h2>
<div _ngcontent-xwy-0=""></div>
</div>
Since there is no way to specify a wildcard attribute name CSS selector (i.e. [_ngcontent-*] { cursor: pointer }
, there is no way to achieve this using just CSS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With