Skip to content

Instantly share code, notes, and snippets.

@duycuong87vn
Created March 28, 2014 20:44
Show Gist options
  • Save duycuong87vn/9842618 to your computer and use it in GitHub Desktop.
Save duycuong87vn/9842618 to your computer and use it in GitHub Desktop.
<!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>
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