(function() {
angular.module("myDir", []).directive("myDir", myDir);
function myDir() {
return {
restrict: "EA",
templateUrl: "app/components/myDir/myDir.template.html",
};
}
}());
var temp = "<div myDir></div>";
var content = $compile(temp)({});
Angular normalizes an element's tag and attribute name to determine which elements match which directives. We typically refer to directives by their case-sensitive camelCase normalized name (e.g. ngModel). However, since HTML is case-insensitive, we refer to directives in the DOM by lower-case forms, typically using dash-delimited attributes on DOM elements (e.g. ng-model).
var temp = "<div my-dir></div>";