Skip to content

Instantly share code, notes, and snippets.

@Finkes
Created August 15, 2016 08:45
Show Gist options
  • Save Finkes/a673d3ad9a55f36c6d1b6d10c8be8195 to your computer and use it in GitHub Desktop.
Save Finkes/a673d3ad9a55f36c6d1b6d10c8be8195 to your computer and use it in GitHub Desktop.
import {Directive, Input, ElementRef} from '@angular/core';
@Directive({
selector: '[tooltip]',
host: {
'(mouseenter)': 'show($event)'
}
})
export class Tooltip {
constructor(element: ElementRef){
console.log(element);//.nativeElement.getBoundingClientRect());
}
@Input('tooltip') text: string;
show(event) {
console.log(event);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment