宝哥软件园

举例简介AngularJS的内部语言环境

编辑:宝哥软件园 来源:互联网 时间:2021-09-09

AngularJS支持内置的国际化三种类型的过滤器货币,日期和数字。只需要根据国家的区域纳入相应的JS。默认情况下它处理浏览器的语言环境。例如,要使用丹麦语的语言环境,使用下面的脚本

脚本src=' http :3359代码。安格拉js。org/12 .5/i18n/angular-locale _ da-dk。js '/脚本使用丹麦语的语言环境实例testAngularJS.html

html头部标题角度JS表单/标题/头部主体H2角度JS示例应用程序/H2 div ng-app=' mainApp ' ng-controller=' StudentController ' {费用|货币} } br/br/{ {许可日期|日期} } br/{ {卷号|号码} }/div脚本src=' http 3360http://Ajax。谷歌api。com/Ajax/libs/angular JS/1。2 .15/棱角分明。量滴JS '/脚本脚本mainapp。控制器(' StudentController ',函数($ scope){ $ scope。费用=100;$ scope。许可日期=新日期();$ scope . roll no=123.45 });/脚本/正文/html结果

在网浏览器打开textAngularJS.html。看到结果如下。

2015617114029826.jpg  (560240)

使用浏览器的语言环境示例testAngularJS.html

html头部标题角度JS表单/标题/头部主体H2角度JS示例应用程序/H2 div ng-app=' mainApp ' ng-controller=' StudentController ' {费用|货币} } br/br/{ {许可日期|日期} } br/{ {卷号|号码} }/div脚本src=' http 3360http://Ajax。谷歌api。com/Ajax/libs/angular JS/1。2 .15/棱角分明。量滴JS '/脚本!-脚本src=' http :https://代码。棱角分明的js。org/12 .5/i18n/angular-locale _ da-dk。js '/script-script var mainApp=angular。模块(' mainApp ',[]);mainapp。控制器(' StudentController ',函数($ scope){ $ scope。费用=100;$ scope。许可日期=新日期();$ scope . roll no=123.45 });/脚本/正文/html结果

在网浏览器打开textAngularJS.html。看到结果如下。

2015617114048791.jpg  (560240)

更多资讯
游戏推荐
更多+