<div ng-app='myApp'>
  <div ng-controller='Controller'>
    <div my-attribute-directive></div>
  </div>
</div>
var myApp = angular.module('myApp', []);

myApp.controller('Controller', ['$scope', function($scope) {
  $scope.elementName = "Directive with restrict A";
}]);

myApp.directive('myAttributeDirective', function() {
  return {
        restrict : "A",
        template : "<h1>{{elementName}}</h1>"
    };
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.5/angular.min.js