Multiple Directives -Method 1

by gogirl

HTML

<div ng-app='myApp'>
<XMP>
                    <div my-d></div>
                    <div my-d1></div>
                    <my-d1></my-d1>
                    <p my-d1></p>
                </XMP>
                <p>As default, the directives can  now be applied as attributes to html tags</p>
                <p>To define as an element and use as a tag another method is used</p>
                        <p>
                            output:

                        <div my-d></div>
                        <div my-d1></div>
                        <my-d1></my-d1>
                        <p my-d1></p>

                        </p>
</div>

JavaScript

var app = angular.module("myApp", []);

    app.directive('myD', function() {
        return {
            template: 'Similar to ng-include: tag will not work as element'
        };
    });
    app.directive('myD1', function() {
        return {
            template: 'Similar to ng-include: tag will not work as element'
        };
    });