-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCustom-Directive.html
More file actions
30 lines (30 loc) · 885 Bytes
/
Custom-Directive.html
File metadata and controls
30 lines (30 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<!doctype html>
<html ng-app="docsSimpleDirective">
<head>
<title>Custom Directive using AngularJS</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
<script type="text/javascript">
angular.module('docsSimpleDirective', [])
.controller('Controller', ['$scope', function($scope) {
$scope.customer = {
name: 'Naomi',
address: '1600 Amphitheatre'
};
}])
.directive('myCustomer', function() {
return {
template: 'Name: {{customer.name}} Address: {{customer.address}}'
};
});
</script>
</head>
<body>
<div style="float:left;"><h2>Custom Directive using AngularJS</h2></div>
<div style="float:right;"><img src="../images/infosys.gif" alt="Infosys" title="Infosys" style="width:420px;" /></div>
<div style="clear:both;"></div>
<hr />
<div ng-controller="Controller">
<div my-customer></div>
</div>
</body>
</html>