Ng-List-3

 

In this example the textbox is bind with the listNum array, when you type comma separated numbers in the textbox the ng-list directive make list of the binded numbers and show in the json format.

 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="app"> <div ng-controller="controllerName"> <p>Type comma ( , ) separated number.</p> <input type="text" ng-model="listNum" placeholder="Enter numbers" ng-list size=60> <pre>{{listNum|json}}</pre> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.listNum=[2,3,4] }]); </script> </body> </html>
Output