JSFiddle - React, Tailwind, and code Playground
by Yang Tyler
HTML
<script src="http://code.angularjs.org/1.2.26/angular.js"></script>
<div ng-app="MyApp">
<div ng-controller="MainController">
<span>{{testText1}}</span><br/>
<span>{{testText2}}</span>
</div>
</div>
JavaScript
var myApp = angular.module("MyApp", []);
myApp.$run(function($document){
$document.bind('click', function(e){
console.log('click happen');
});
});
myApp.controller("MainController", function($scope){
$scope.testText1 = "test11111";
$scope.testText2 = "test2222222";
});
myApp.directive('testClick', function(){
return{
restrict: "E",
link: function(scope, element, attrs){
element.on("mousedown", function(e){
console.log("mousedown");
});
}
}
});