Is there a simple way to set cursor: pointer on (tap) items?


#1

The problem: I want everything in my app that has a (tap) event handler to also have cursor: pointer css applied to it. I’ve done this in ng1 apps because the event doodad typically left an attribute on the element (like I could do [ui-sref]: { cursor: pointer; } most of the time, for example).

It looks like the (tap) event doesn’t leave any real grippy residue behind for me to do a simple css selector. Is there a fancy config setting I can put somewhere, or am I stuck attaching an additional class to all of these elements? I can do that too, it’s just inelegant (and brittle).


#2

Does not seem feasible - i did a really simple attribute directive like so:

import { Directive, ElementRef } from '@angular/core';

@Directive({
  selector: '[tap]',
})
export class TapCursor {
  constructor(el: ElementRef) {
    el.nativeElement.style.cursor = 'pointer';
  }
}

which I thought would be clever, but instead it turns out that pretty much every ionic item already has a (tap) attribute by default, but a lot of them are no-ops. So I guess I need to take a different approach.