<!DOCTYPE html>
<html ng-app="app">

  <head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.js"></script>
    <script src="script.js"></script>
  </head>

  <body ng-controller="PruebaController">
    <ac-titulo></ac-titulo>
  </body>

</html>
var app = angular.module("app", []);

app.directive("acTitulo",[function() {
  
  var directiveDefinitionObject ={
    restrict:"E",
    replace:true,
    template:"<h1>Hola Mundo</h1>"
  }
  
  return directiveDefinitionObject;
}]);

app.controller("PruebaController", function($scope) {

});
Ejemplo de directiva básica