ng-list with line break as textarea delimter in AngularJS >1.3

落花浮王杯 提交于 2019-12-05 04:18:41

We should use ng-trim="false". See updated plunker

 <textarea name="namesInput" 
 ng-list="&#10;"
 ng-model="names"
 ng-trim="false"
 required cols="40" rows="20"></textarea>

See the doc ngList (small cite:)

If ngTrim is set to "false" then whitespace around both the separator and each list item is respected. This implies that the user of the directive is responsible for dealing with whitespace but also allows you to use whitespace as a delimiter, such as a tab or newline character.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!