Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body ng-app="testApp">
<h2>Using Element Name:</h2>
<test-directive></test-directive>
<h2>Using Attribute:</h2>
<div test-directive></div>
<script>
var app = angular.module("testApp", []);
app.directive("testDirective", function() {
    return {
                template : "<h3>Custom directive message.</h3>"
    };
});
</script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x