I can't get the directiv i angular to bind on mouseenter, i have tried in a simple example, what is wrong here?
<html lang="en" >
<head>
<title>My AngularJS test</title>
<script src="angular.js"></script>
</head>
<body >
<div ng-app="testApp" ng-controller="testCtr">
<div testDir>test here</div>
<!-- just testing to see if the app is working -->
{{test}}
<script type="text/javascript">
var app = angular.module("testApp", []);
app.directive("testDir", function(){
return {
link: function(scope, element, attrs){
element.bind("mouseenter", function(){
console.log("enter")
})
}
}
})
app.controller("testCtr", function($scope) {
$scope.test = 500;
})
</script>
</div>
</body>
</html>
IT is probably a stupid mistake, but i can't see it.
console.log("enter");being one. What does the log say?