UNPKG

client-ui

Version:

Testing implementation of nodeJs Backend, angular frontend, and hopefully in a way that this can be deployed to s3/cloudfront

25 lines (20 loc) 719 B
(function () { 'use strict'; angular.module(moduleName).directive('hoverClass', hoverClassController); hoverClassController.$inject = []; function hoverClassController() { return { link: function (scope, el, attrs) { scope.$watch(attrs.hoverClass, function (newValue) { if (angular.isUndefined(newValue)) return; el.bind('mouseover', function (e) { el.addClass(attrs.hoverClass); }); el.bind('mouseleave', function (e) { el.removeClass(attrs.hoverClass); }); }); } } } })();