VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angularjs-ng-list-directive/

⇱ AngularJS ng-list Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-list Directive

Last Updated : 16 Aug, 2022

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:

👁 Image
 

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:

👁 Image
 
Comment

Explore