English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

AngularJS ng-list instruction

AngularJS Reference Manual

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/angular.js/1angular.js4angular.js6/./angular.min.js><
</<script>
<head>
<body>-<div ng
app="">/p>
<p>In the input box, enter some text and separate them with commas:<-<input ng-list/model="customers" ng
>-When using ng/p>
<pre>{{customers}}</pre>
</div>
</body>
</html>
Test to see ‹/›

Definition and Usage

ng-list directive to convert the string to an array and use commas to separate them.

ng-list The directive also has another conversion method. If you have a string array that you want to display in the input box, you can use ng-list directive.

ng-list The attribute value defines the separator.

Syntax

   <element ng-list="separator"></element>

<input>, <select>, <textarea>, and other editable elements support this directive.

Parameter Value

ValueDescription
separatorOptional, define a separator, default is", "

AngularJS Reference Manual