JSFiddle - React, Tailwind, and code Playground
by yonet3d
HTML
<body ng-app="app">
<superwoman classy="classyClass">Superwoman here!</superwoman>
</body>
CSS
.classyClass {
font-size: 20px;
color: red;
}
JavaScript
var app = angular.module('app', [])
app.directive('superwoman', [function(){
return {
restrict: "E",
link: function(scope, element, attrs) {
}
}
}])
app.directive('classy', [function(){
var link = function(scope, element, attrs) {
element.bind('mouseenter', function(){
element.addClass(attrs.classy);
})
}
return {
restrict:"A",
link: link
}
}])