Ng-List-4

 

Ng-list directive display the textbox text in array form seprated by "-".Textbox value bind to list variable which will display the text.

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