AngularJS supports built-in internationalization of three types of filter currencies, dates and numbers. Only the corresponding JS needs to be included according to the country's region. By default it handles the browser's locale. For example, to use a Danish locale, use the following script
<script src="https://code.angularjs.org/1.2.5/i18n/angular-locale_da-dk.js"></script>
Locale examples using Danish
testAngularJS.html
<html><head> <title>Angular JS Forms</title></head><body> <h2>AngularJS Sample Application</h2> <div ng-app="mainApp" ng-controller="StudentController"> {{fees | currency }} <br/><br/> {{admissiondate | date }} <br/> {{rollno | number }} </div> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> <script src="https://code.angularjs.org/1.2.5/i18n/angular-locale_da-dk.js"></script> <script> var mainApp = angular.module("mainApp", []); mainApp.controller('StudentController', function($scope) { $scope.fees = 100;$scope.admissiondate = new Date(); $scope.rollno = 123.45; }); </script></body></html>result
Open textAngularJS.html in a web browser. The results are as follows.
AngularJS Internalization Locale Example Using Browser
testAngularJS.html
<html><head> <title>Angular JS Forms</title></head><body> <h2>AngularJS Sample Application</h2> <div ng-app="mainApp" ng-controller="StudentController"> {{fees | currency }} <br/><br/> {{admissiondate | date }} <br/> {{rollno | number }} </div> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> <!-- <script src="https://code.angularjs.org/1.2.5/i18n/angular-locale_da-dk.js"></script> --> <script> var mainApp = angular.module("mainApp", []); mainApp.controller('StudentController', function($scope) { $scope.fees = 100;$scope.admissiondate = new Date(); $scope.rollno = 123.45; }); </script></body></html>result
Open textAngularJS.html in a web browser. The results are as follows.
The above is the collection of information on AngularJS internationalization. We will continue to organize relevant information in the future. Thank you for your support to this site!