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

Commit a790b94

Browse files
ciplazarpkozlowski-opensource
authored andcommitted
demo(accordion): fix off-by-one error in accordion demo item list
Add 1 to items.length before pushing, otherwise we get two items with the same item number.
1 parent 752ef73 commit a790b94

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/accordion/docs/demo.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ function AccordionDemoCtrl($scope) {
1515
$scope.items = ['Item 1', 'Item 2', 'Item 3'];
1616

1717
$scope.addItem = function() {
18-
$scope.items.push('Item ' + $scope.items.length);
18+
var newItemNo = $scope.items.length + 1;
19+
$scope.items.push('Item ' + newItemNo);
1920
};
20-
}
21+
}

0 commit comments

Comments
 (0)