'use strict';

/**
 * @ngdoc filter
 * @name annotationAppApp.filter:enrichArrayElementsWithIndex
 * @function
 * @description
 * # enrichArrayElementsWithIndex
 * Filter in the annotationAppApp.
 */
angular.module('app')
	.filter('enrichArrayElementsWithIndex', function() {
		return function(input) {
			if (!input) {
				return [];
			}
			return input.map(function(el, index) {
				el._index = index;
				return el;
			});
		};
	});