![]() |
VOOZH | about |
The ng-list Directive in AngularJS is used for separating input strings and converting them into an array of strings using a separator. By default, the comma is used as a default separator. But any custom separator can be used as the value of the ng-list directive.
Syntax:
<element ng-list="delimiter"> Contents... </element>
The value of ng-list specifies the separator to be used for separating the input string.
Example 1: This example uses the ng-list Directive to convert input into an array.
Output:
Example 2: In this example, when we include the ng-list Directive, then it will convert the text in the input field into an array.
Output: