Skip to content

Commit c36bab6

Browse files
committed
fix($limitTo): properly handle excessive limits
Closes angular#571
1 parent 2508768 commit c36bab6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/apis.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ var angularArray = {
714714
expect(binding('numbers.$limitTo(limit) | json')).toEqual('[1,2,3]');
715715
});
716716
717-
it('should update the output when -3 is entered', function() {
717+
it('should update the output when -3 is entered', function() {
718718
input('limit').enter(-3);
719719
expect(binding('numbers.$limitTo(limit) | json')).toEqual('[7,8,9]');
720720
});
@@ -723,8 +723,6 @@ var angularArray = {
723723
input('limit').enter(100);
724724
expect(binding('numbers.$limitTo(limit) | json')).toEqual('[1,2,3,4,5,6,7,8,9]');
725725
});
726-
727-
728726
</doc:scenario>
729727
</doc:example>
730728
*/

test/ApiSpecs.js

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ describe('api', function(){
186186
expect(angular.Array.limitTo({}, 1)).toEqual([]);
187187
});
188188

189+
189190
it('should return a copy of input array if X is exceeds array length', function () {
190191
expect(angular.Array.limitTo(items, 19)).toEqual(items);
191192
expect(angular.Array.limitTo(items, '9')).toEqual(items);

0 commit comments

Comments
 (0)