Skip to content
Related Articles

Related Articles

AngularJs | ng-list Directive

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 26 Aug, 2021

The ng-list Directive in AngularJS is used for separating input string and convert it into an array of string using a separator. By default comma is used as a default separator. But any custom separator can be used as value of ng-list directive.


 <element ng-list="delimiter"> Contents... </element> 

The value of ng-list specifies the separator to be used for separating the input string.

Example: This example uses ng-list Directive to convert input into array.  


<!DOCTYPE html>
    <title>ng-list Directive</title>
    <script src=
<body ng-app="app" style="text-align:center">
    <h1 style="color:green">GeeksforGeeks</h1>
    <h2>ng-list Directive</h2>
    <div ng-controller="geek">
<p>Enter Input: <input type="text"
                ng-model="list" ng-list="-">
        var app = angular.module("app", []);
        app.controller('geek', ['$scope', function ($scope) {
            $scope.list = [];



Supported Browser:

  • Google Chrome
  • Microsoft Edge
  • Firefox
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!