JSFiddle - React, Tailwind, and code Playground
by chandings
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.20/angular.js"></script>
<div ng-app="myApp" ng-controller="myController">
<fr-input></fr-input>
</div>
JavaScript
var app = angular.module("myApp",[]);
app.controller("myController", function($scope){
$scope.data = "asf";
});
app.directive("frInput", function(){
return {
scope:{
"validator":"@",
"min":"@",
"max":"@",
},
template:"<input ng-change='changeHandler()' ng-blur='blurHandler()' ng-focus='focusHandler()' >",
link:function(scope, elem, attr, ctrl){
scope.changeHandler = function(){
console.log("change");
}
scope.blurHandler = function(){
console.log("blur");
}
scope.focusHandler = function(){
console.log("focus");
}
}
}
})