Created
March 28, 2014 20:44
-
-
Save duycuong87vn/9842618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html data-ng-app="docsSimpleDirective"> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>AngularJS Example</title> | |
</head> | |
<body> | |
<div data-ng-controller="Ctrl1"> | |
<div data-my-customer></div> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('docsSimpleDirective', []) | |
.controller('Ctrl1', function($scope){ | |
$scope.customer = { | |
name: 'Black', | |
address: '123 PK' | |
}; | |
}) | |
.directive('myCustomer', function(){ | |
return{ | |
template : 'Name :{{customer.name | uppercase}} Address: {{customer.address | lowercase}}' | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment