Skip to content

Instantly share code, notes, and snippets.

@blambeau
Created June 19, 2014 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blambeau/b865bd2fdacb1f821ac5 to your computer and use it in GitHub Desktop.
Save blambeau/b865bd2fdacb1f821ac5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.8/angular.js"></script>
<script>
var myApp = angular.module('myApp', [
]);
myApp.directive('bang', function() {
return {
link: function(scope, element, attr) {
element.on('click', function(){
throw new Error("Bang!");
});
}
};
});
myApp.factory('$exceptionHandler', function(){
return function (exception, cause) {
console.log("Exception handler");
console.log(exception);
};
});
</script>
</head>
<body>
<p bang="">Click for bang</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment