Skip to content

Instantly share code, notes, and snippets.

View cjgajard's full-sized avatar
😸
にゃあ

Carlos Gajardo cjgajard

😸
にゃあ
  • Santiago de Chile
View GitHub Profile
@cjgajard
cjgajard / hover-class.directive.ts
Last active March 20, 2017 21:06 — forked from TigorC/hover-class.directive.ts
Angular 2 hover class directive ES6
import { Directive, ElementRef, Renderer } from '@angular/core';
/*
* Adds a class to a DOM element when the mouse is over its box (:hover).
* This DOESN'T support adding multiple classes separated by spaces.
* Usage:
* <button class="btn" hoverClass="btn-success">
*/
const HoverClassDirective = class {
constructor(elementRef, renderer) {