<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>"
};
});
This Pen doesn't use any external CSS resources.