AngularJS ng-list 指令
AngularJS 教程
· 2019-04-01 19:58:36
AngularJS 实例
转换用户的输入为数组:
<div ng-app="">
<input ng-model="customers" ng-list/>
<pre>{{customers}}</pre>
<input ng-model="customers" ng-list/>
<pre>{{customers}}</pre>
定义和用法
ng-list 指令将字符串转换为数组,并使用逗号分隔。
ng-list 指令还有另外一种转换方式,如果你有字符串数组希望在输入框中显示,你可以在 input 上使用 ng-list 指令。
ng-list
属性值定义了分隔符。
语法
<element ng-list="separator"></element>
<input>, <select>, <textarea>, 和其他可编辑元素支持该指令。
参数值
值 | 描述 |
---|---|
separator | 可选,定义分隔符,默认为", " |
点击查看所有 AngularJS 教程 文章: https://www.codercto.com/courses/l/36.html
The Mechanics of Web Handling
David R. Roisum
This unique book covers many aspects of web handling for manufacturing, converting, and printing. The book is applicable to any web including paper, film, foil, nonwovens, and textiles. The Mech......一起来看看 《The Mechanics of Web Handling》 这本书的介绍吧!