From 0a71753ce3f4fe241e15fa489617b82710be4648 Mon Sep 17 00:00:00 2001 From: Zhenbo Zhang Date: Wed, 9 May 2012 00:00:38 +0300 Subject: fix(ng-repeat) to work with primitive types --- src/apis.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/apis.js') diff --git a/src/apis.js b/src/apis.js index 7b470802..098d9cdd 100644 --- a/src/apis.js +++ b/src/apis.js @@ -97,5 +97,15 @@ HashQueueMap.prototype = { return array.shift(); } } + }, + + /** + * return the first item without deleting it + */ + peek: function(key) { + var array = this[key = hashKey(key)]; + if (array) { + return array[0]; + } } }; -- cgit v1.2.3