Currently, I have this function in use:
$scope.myFunction = function(indexParent, childrenLength) {
// close all inner accordion tabs
for(i=0; i < childrenLength; i++) {
!$scope.lettersandnumbers[indexParent].things[i].open = $scope.lettersandnumbers[indexParent].things[i].open;
}
// toggle parent tab
$scope.lettersandnumbers[indexParent].open = !$scope.lettersandnumbers[indexParent].open;
}
In the section where it says:
<button ng-click="myFunction(0, 3)">Toggle a</button>
However, the 'close all inner accordion tabs' part is causing an issue with the Invalid left-hand side in assignment error. How can I modify the code to resolve this problem?
If you'd like to test the code, you can find it here: https://plnkr.co/edit/TlKhBZer1wYMW0XXBcqO?p=preview
Thank you very much
UPDATE
You can find the solution with some changes made here: https://plnkr.co/edit/aMD5rGxpe48lziTb6xPk?p=preview