Skip to content

Instantly share code, notes, and snippets.

@pfallasro
Created March 2, 2014 22:01
Show Gist options
  • Save pfallasro/9314653 to your computer and use it in GitHub Desktop.
Save pfallasro/9314653 to your computer and use it in GitHub Desktop.
Angular directive behavior
var myApp = angular.module('behaviorApp', []);
app.directive("enter", function () {
return function (scope, element) {
element.bind("mouseenter", function () {
console.log("I'm inside of you");
})
}
})
app.directive("leave", function () {
return function (scope, element) {
element.bind("mouseleave", function () {
console.log("I'm leaving of you");
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment