Tuesday, January 30, 2018

Write a program for filter in angularJS.

  • Filters can be added in AngularJS to format data.
  • The currency filter formats a number as currency:
Program

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js">
</script>
</head>
<body>
<div ng-app="Abc" ng-controller="def">
<h1> price:{{ price | currency}}</h1>
</div>
<script>
var app=angular.module('Abc',[]);
app.controller('def', function ($scope)
{
$scope.price=60;
});
</script>
</body>
</html>

Output


0 comments:

Post a Comment

Thanks For Commented.

TechTalk