Test custom tag names in Angular Directive template

by redaemn

HTML

<div ng-app="customModule">
    <div ng-controller="controller">
        Hello {{text}}!!
    </div>
    <div>
        Hello <span parent></span>!!
    </div>
</div>

JavaScript

function controller($scope) {
    $scope.text = "world";
}

angular.module('customModule', [])

.directive("parent", function() {
    return {
        template: "<child></child>"
    };
})

.directive("child", function() {
    return {
        restrict: 'EA',
        template: "world"
    };
});