From 91a34a7027caf0a3f0f4bdaf6649fb6cf479bba8 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 19 Apr 2011 13:50:15 -0700 Subject: remove ng:format=index --- src/formatters.js | 61 ------------------------------------------------------- 1 file changed, 61 deletions(-) (limited to 'src/formatters.js') diff --git a/src/formatters.js b/src/formatters.js index b484f26f..3eb71bfd 100644 --- a/src/formatters.js +++ b/src/formatters.js @@ -199,64 +199,3 @@ angularFormatter.list = formatter( angularFormatter.trim = formatter( function(obj) { return obj ? trim("" + obj) : ""; } ); - -/** - * @workInProgress - * @ngdoc formatter - * @name angular.formatter.index - * @deprecated - * @description - * Index formatter is meant to be used with `select` input widget. It is useful when one needs - * to select from a set of objects. To create pull-down one can iterate over the array of object - * to build the UI. However the value of the pull-down must be a string. This means that when on - * object is selected form the pull-down, the pull-down value is a string which needs to be - * converted back to an object. This conversion from string to on object is not possible, at best - * the converted object is a copy of the original object. To solve this issue we create a pull-down - * where the value strings are an index of the object in the array. When pull-down is selected the - * index can be used to look up the original user object. - * - * @inputType select - * @param {array} array to be used for selecting an object. - * @returns {object} object which is located at the selected position. - * - * @example - - - -
- User: - - - user={{currentUser.name}}
- password={{currentUser.password}}
- - - it('should retrieve object by index', function(){ - expect(binding('currentUser.password')).toEqual('guest'); - select('currentUser').option('2'); - expect(binding('currentUser.password')).toEqual('abc'); - }); - - - */ -//TODO: delete me since this is replaced by ng:options -angularFormatter.index = formatter( - function(object, array){ - return '' + indexOf(array || [], object); - }, - function(index, array){ - return (array||[])[index]; - } -); -- cgit v1.2.3