Directive Usage

by Joe Saad

HTML

<div ng-app="myApplication" ng-controller="mainCtrl">
    Some content ...
    <div my-directive="testing">
        Some more content ...
    </div>
    <joe></joe>
    
</div>

JavaScript

/* Embedded Fragment - applicationModule */
/*
 PROCESS_HIGHLIGHT
 ["mySharedElements"]
 */
var myApplication = angular.module("myApplication", ["mySharedElements"]);
/* Fragment End - applicationModule */




/* Embedded Fragment - mySharedElements */
var mySharedElements = angular.module("mySharedElements", []);

mySharedElements.directive("joe", function () {
   return {
      restrict: "E",
//      transclude: true,
      template: "<h1>Test this Joe in {{person.place}}</h1>",
   };
});

/* Fragment End - mySharedElements */



angular.module("myApplication").controller("mainCtrl", function ($scope) {
   $scope.person = {
    	"age": "34",
        "place": "Houston, TX"
    };
})