Skip to content

Instantly share code, notes, and snippets.

@niisar
Created December 11, 2014 01:37
Show Gist options
  • Save niisar/54a65b900e006342a69b to your computer and use it in GitHub Desktop.
Save niisar/54a65b900e006342a69b to your computer and use it in GitHub Desktop.
Template and TemplateURL
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="js/angular.js"></script>
<script>
myapp = angular.module("myapp", []);
myapp = angular.module("myapp", []);
myapp.directive('div', function () {
var directive = {};
directive.restrict = 'E'; /* restrict this directive to elements */
/* template */
//directive.template = "My first directive: {{textToInsert}}";
/* templateUrl */
directive.templateUrl = "/Htmlpage1.html";
return directive;
});
myapp.controller("MyController", function ($scope, $http) {
$scope.textToInsert = "kk";
});
</script>
</head>
<body ng-app="myapp" ng-controller="MyController">
<div></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment