Angular.js – using ng-repeat and custom currency filter
A simple Angular.js example of using the ng-repeat with custom currency filter and two way data binding to list people from the controller.
<!DOCTYPE html>
<html ng-app="testApp">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen Angular.js example"/>
<title>Tizen Angular.js example</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/angular.min.js"></script>
<script>
var app = angular.module('testApp', []);
app.controller('AppController', function($scope) {
$scope.drinks = [{drink:'coffee', price: 12.30000001},
{drink:'tea', price: 10.50},
{drink:'lemonade', price: 11.55075677},
{drink:'orange juice', price:13.29}];
});
</script>
</head>
<body>
<div ng-controller="AppController">
<p>Employee listing</p>
<ul>
<li ng-repeat="x in drinks">
{{ (x.drink | uppercase) + ': ' + (x.price | currency:"PLN ") }}
</li>
</ul>
</div>
</body>
</html>