In the new Angular2 framework, does anyone know the proper way to do a hover like an event?
In Angular1 there was ng-Mouseov
In your js/ts file for the html that will be hovered
@Output() elemHovered: EventEmitter = new EventEmitter();
onHoverEnter(): void {
this.elemHovered.emit([`The button was entered!`,this.event]);
}
onHoverLeave(): void {
this.elemHovered.emit([`The button was left!`,this.event])
}
In your HTML that will be hovered
(mouseenter) = "onHoverEnter()" (mouseleave)="onHoverLeave()"
In your js/ts file that will receive info of the hovering
elemHoveredCatch(d): void {
console.log(d)
}
In your HTML element that is connected with catching js/ts file
(elemHovered) = "elemHoveredCatch($event)"