Created
November 27, 2013 11:23
-
-
Save Drvanon/7674189 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('twitterApp', []); | |
app.directive("enter", function (){ | |
return function (scope, element, attrs) { | |
element.bind('mouseenter', function (){ | |
scope.$apply(attrs.enter); | |
}) | |
} | |
}); | |
app.controller('AppCtrl', function ($scope) { | |
$scope.show = ""; | |
$scope.loadMoreTweets = function () { | |
$scope.show = "Test"; | |
console.log('trigger'); | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Behaviour</title> | |
</head> | |
<body> | |
<div ng-app='twitterApp'> | |
<div ng-controller='AppCtrl'> | |
<div enter='loadMoreTweets()'>Roll over to load more tweets {{ show }}</div> | |
</div> | |
</div> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<script src="behaviour.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment