在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ HTML/ AngularJS國際化
AngularJS國際化
AngularJS表達(dá)式
AngularJS控制器
AngularJS MVC體系結(jié)構(gòu)
AngularJS表單
AngularJS服務(wù)
AngularJS作用域
AngularJS快速入門
AngularJS包括
AngularJS第一個(gè)應(yīng)用程序
AngularJS HTML DOM
AngularJS過濾器
AngularJS模塊
AngularJS Ajax
AngularJS自定義指令
AngularJS教程
AngularJS依賴注入
AngularJS表格
AngularJS指令
AngularJS環(huán)境設(shè)置
AngularJS視圖

AngularJS國際化

AngularJS支持內(nèi)置的國際化三種類型的過濾器貨幣,日期和數(shù)字。只需要根據(jù)國家的區(qū)域納入相應(yīng)的JS。默認(rèn)情況下它處理瀏覽器的語言環(huán)境。例如,要使用丹麥語的語言環(huán)境,使用下面的腳本

<script src="https://code.angularjs.org/1.2.5/i18n/angular-locale_da-dk.js"></script> 

使用丹麥語的語言環(huán)境實(shí)例

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/><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>

結(jié)果

在Web瀏覽器打開textAngularJS.html??吹浇Y(jié)果如下。

AngularJS Internalization

使用瀏覽器的語言環(huán)境示例

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/><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>

結(jié)果

在Web瀏覽器打開textAngularJS.html。看到結(jié)果如下。

AngularJS Internalization
 

上一篇:AngularJS服務(wù)下一篇:AngularJS指令