JSFiddle - React, Tailwind, and code Playground
by hinablue
HTML
<div ng-app="tipapp">
<panel-tip></panel-tip>
<div tips="I'm tip">Here</div>
</div>
JavaScript
var app = angular.module("tipapp", []);
app.directive("tips", function() {
return {
restrict: "A",
link: function( scope, element, attrs ) {
element.bind("mouseenter", function() {
console.log(attrs.tips);
});
}
};
});
app.directive("panelTip", function() {
return {
restrict: "E",
replace: true,
template: '<span>{{tip}}</span>',
link: function( scope, element, attrs ) {
}
};
});