angular.formatter.list

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

Use list formatter if you wish to convert the user entered string to an array.

Dependencies

Usage

In HTML Template Binding

<input type="text" name="bindExpression" ng:format="list">

In JavaScript

var userInputString = angular.formatter.list.format(modelValue);
var modelValue = angular.formatter.list.parse(userInputString);

Parameters

Returns

{Array}

Array parsed from the entered string.

Example

Enter a list of items: <input type="text" name="value" ng:format="list" value=" chair ,, table"/> <input type="text" name="value" ng:format="list"/> <pre>value={{value}}</pre>