Skip to content

Instantly share code, notes, and snippets.

@mfollett
Last active August 29, 2015 13:57
Show Gist options
  • Save mfollett/9405733 to your computer and use it in GitHub Desktop.
Save mfollett/9405733 to your computer and use it in GitHub Desktop.
Simplest possible AngularJS directive
(function () {
angular.module('simplest', [])
.directive( 'hello', function () {
return {template: '<span>Hello, world!</span>'};
});
})();
<html ng-app='simplest'>
<head>
<title>The Simplest Possible Thing to Break</title>
<script data-require="angular.js@1.2.13" data-semver="1.2.13" src="http://code.angularjs.org/1.2.13/angular.js"></script>
<script src="app.js"></script>
</head>
<body>
<div hello></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment