Ng-List-5

 

Ng-list directive display the textbox text in json format seprated by "-".Textbox value bind to list variable which will display the text.Ng-trim=false means it will not trim the value of textbox.

 
 
 
<!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 dash( - ) separated names.(ng-trim='false')</p><input type="text" ng-model="list" ng-list="-" ng-trim="false"><br /> <pre>{{list|json}}</pre> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.list = ["Learn", "It"]; }]); </script> </body> </html>
Output