First directive
HTML
<div ng-app="myApp">
<firstdirective></firstdirective>
</div>
JavaScript
var app = angular.module("myApp", []);
app.directive('firstdirective', function() {
return {
restrict: 'E',
template: '<div>Hello world</div>'
}
});