<html>
<head>
<title>Tables</title>
<script src="angular.min.js"></script>
<script type="text/javascript">
var app = angular.module("tablesApp", []);
app.filter('range', function () {
return function (out, total) {
total = parseInt(total);
for (var i = 1; i <= total; i++)
out.push(i);
return out;
};
});
</script>
</head>
<body ng-app="tablesApp">
<div>
<b>Tables:</b>
<div>
Enter Number: <input type="number" min="0" ng-model="num">
</div>
<div>
Count: <input type="number" min="0" ng-model="count">
</div>
<div ng-repeat="n in [] | range:count">
{{num}}* {{n}}={{num * n }}
</div>
</div>
</body>
</html>
UI: How it looks
No comments:
Post a Comment