I have tried a basic angularjs app. My controller is working ok but template in directive doesn't seems to work, please suggest the solution.
Below is my code
index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" data-ng-app="DataApp1">
<head>
<script src="Scripts/angular.min.js"></script>
</head>
<body>
<div data-ng-controller="DataController1">
<data-directive> </data-directive>
</div>
<script src="Scripts/App.js"></script>
</body>
</html>
app.js
/// <reference path="angular.js" />
var myapp = angular.module("DataApp1", []);
myapp.controller("DataController1", function ($scope) {
});
myapp.directive("dataDirective", function () {
return {
restrict: 'E',
template: '<h2>Hi</h2>'
};
});