<!DOCTYPE html>
<html>
<script src="http://www.sargonco.com/Uploads/Public/article/webdistut/javascript/angular.min.js"></script>

<body>

<!-- directive: w3-test-directive -->

<script>
var app = angular.module("myApp", []);
app.directive("w3TestDirective", function() {
    return {
        restrict : "M",
        replace : true,
        template : "<h1>Made by a directive!</h1>"
    };
});
</script>

<p><strong>Note:</strong> We've added the <strong>replace</strong> property in this example, otherwise the comment would be invisible.</p>

<p><strong>Note:</strong> You must add the value "M" to the <strong>restrict</strong> property to be able to invoke the directive from a comment.</p>

</body>
</html>

Note: We've added the replace property in this example, otherwise the comment would be invisible.

Note: You must add the value "M" to the restrict property to be able to invoke the directive from a comment.