Created
June 19, 2014 20:14
-
-
Save blambeau/b865bd2fdacb1f821ac5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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