[AngularJS] ngMessageFormat
2024-10-13 19:55:51
ngMessageFormat
can be installed via npm using the following command:
$ npm install angular-message-format --save
angular.module('myApp', ['ngMessageFormat']);
Pluralization with ngMessageFormat
With ngMessageFormat
included, we can overload Angular expressions using a comma like this:
{{EXPRESSION, TYPE,
=VALUE { MESSAGE }
...
}}
Example:
{{numberOfMessages, plural,
=0 { You have no new messages }
=1 { You have one new message }
other { You have # new messages }
}}
{{genderExpression, select,
male { Send him a message. }
female { Send her a message. }
other { Send them a message. }
}}
Link: http://blog.thoughtram.io/angular/2015/12/10/ng-message-format-the-unheard-feature-in-angular.html
最新文章
- ReactJS入门(一)—— 初步认识React
- 3个普通IO识别22个按键试验(转)
- Cocoapods在OS X Yosemite上升级时 报错的解决方法
- 《Head First Java》读书笔记(1) - Java语言基础
- 在CentOS6上编译安装实现LAMP(php-modules)+phpMyAdmin安装过程全记录
- CTF--web
- 【Java并发.4】对象的组合
- thinkcmf 相关
- webapi框架搭建-webapi异常处理
- 错误不能中断(不许因错误或异常而产生阻断性Bug)
- Jenkins分布式构建
- jquery animate动画持续运动
- python之列表操作
- VMware vCenter Server 6.5.0 U1g
- PHP的XML Parser(转)
- PHP------数组和对象相互转化,stdClass Object转array
- PAT——1075. 链表元素分类(25)
- Linux系统下超级用户密码的修改
- VMware虚拟机安装Centos7详细步骤过程(图文)[转载]
- 《从零开始学Swift》学习笔记(Day 17)——Swift中数组集合
热门文章
- 创建DBLink语句
- trie树信息抽取之中文数字抽取
- iOS开发之四张图说明GCD(Grand Central Dispatch)附Test源码
- cas sso单点登录系列4_cas-server登录页面自定义修改过程(jsp页面修改)
- 交叉编译:cannot find /lib/libc.so.6 collect2: ld returned 1 exit status
- python 文件系统
- C#制作ActiveX控件及部署升级(摘自网络)
- jquery工具函数browser() 辨别浏览器
- 无法嵌入互操作类型“Microsoft.Office.Interop.Word.ApplicationClass”。请改用适用的接口。
- WebService cxf 接口中获得拦截器参数