Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-list Directive

AngularJS ng-list Instruction

AngularJS Reference Manual AngularJS Reference Manual


AngularJS Examples

Convert the user's input into an array:

<

div

ng-app=

""

<

input

ng-model=

"customers"

ng-list/

<

pre

{{customers}}

<

/pre

Try it »


Definition and Usage

ng-list The directive converts a string into an array, separated by commas.

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

ng-list The attribute value defines the separator.


Syntax

<

element

ng-list=

"separator"

<

/element

,


Parameter value

Value Description
separator Optional, defines the separator, default is **"**, "****

AngularJS Reference Manual AngularJS Reference Manual