Skip to content

Instantly share code, notes, and snippets.

@cyrusdavid
Last active December 26, 2015 22:29
Show Gist options
  • Save cyrusdavid/7223231 to your computer and use it in GitHub Desktop.
Save cyrusdavid/7223231 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html ng-app="">
<head>
<title>oncopy event example</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" />
</head>
<body ng-controller="Main">
<div ng-copy="log('Copy blocked!');">Try copying this text!</div>
<h3>Log</h3>
<pre ng-bind="dump"></pre>
<script src="http://code.angularjs.org/1.2.0-rc.3/angular.min.js"></script>
<script src="script.js"></script>
</body>
</html>
function Main($scope) {
$scope.dump = "";
$scope.log = function(txt) {
$scope.dump += txt + "\n";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment