Skip to content

Instantly share code, notes, and snippets.

@duycuong87vn
Last active August 29, 2015 13:57
Show Gist options
  • Save duycuong87vn/9841337 to your computer and use it in GitHub Desktop.
Save duycuong87vn/9841337 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html data-ng-app="">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>AngularJS review</title>
</head>
<body>
<div data-ng-controller="SimpleController">
Enter name :
<br />
<input type="text" data-ng-model="name"/>
<br />
<ul>
<li data-ng-repeat="cust in customers | filter:name | orderBy:'city' ">{{cust.name | uppercase}} -- {{cust.city | lowercase}}</li>
</ul>
</div>
</body>
</html>
function SimpleController($scope){
$scope.customers = [
{name:'Jone Done', city:'New York'},
{name:'Jason Statham', city:'California'},
{name:'Wolo Wolo',city:'VietName'},
{name:'Think',city:'Washington'},
{name:'TuanAnh',city:'New York'}
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment