Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
demo(accordion): fix off-by-one error in accordion demo item list
Browse files Browse the repository at this point in the history
Add 1 to items.length before pushing, otherwise we get two items with the same item number.
  • Loading branch information
ciplazar authored and pkozlowski-opensource committed Feb 5, 2013
1 parent 752ef73 commit a790b94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/accordion/docs/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function AccordionDemoCtrl($scope) {
$scope.items = ['Item 1', 'Item 2', 'Item 3'];

$scope.addItem = function() {
$scope.items.push('Item ' + $scope.items.length);
var newItemNo = $scope.items.length + 1;
$scope.items.push('Item ' + newItemNo);
};
}
}

0 comments on commit a790b94

Please sign in to comment.