JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<upload>
<input onchange="ctrlUpload.addFile()" type="file">
</upload>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script>
var app = angular.module('graphicsApp',[]);
app.directive('upload',function(){
return {
controllerAs : 'ctrlUpload',
controller : function() {
this.addFile = function(file){
alert(1);
};
}
}
});
</script>
</body>