I generate "ui-bootstrap accordion" by ng-repeat
. I want upddate value of list dynamically. But when I update nested list value, second accordion
is not working.
<uib-accordion close-others="oneAtATime">
<uib-accordion-group heading="{{prInfo.name}}"
data-ng-repeat="(a,prInfo) in allPersonInfoNames | filter:prSearchFilter">
Below iss the inner accordion
<uib-accordion close-others="oneAtATime">
<uib-accordion-group heading="Static Payroll Header, inner accordion"
data-ng-repeat="(b,payroll) in prInfo.banks">
This content is straight in the template.
</uib-accordion-group>
</uib-accordion>
</uib-accordion-group>
<uib-accordion-group heading="{{group.title}}" ng-repeat="group in groups1">
{{group.content}}
</uib-accordion-group>
</uib-accordion>
This code is work correctly, but when I generate list of banks
after loading the html, accordion
not working.
add
ng-click="getBanks(prInfo)"
to first accordion:
<uib-accordion-group heading="{{prInfo.name}}"
data-ng-repeat="(a,prInfo) in allPersonInfoNames | filter:prSearchFilter"
ng-click="getBanks(prInfo)">
$scope.getBanks = (personInfo) ->
$scope.prResPromise = Cartable.httpReq('GET', "getBanks/#{personInfo.dbId}", null, (res) ->
if res.isSuccess
pi = _.findWhere($scope.allPersonInfoNames, {'dbId' : personInfo.dbId})
index = $scope.allPersonInfoNames.indexOf(pi)
$scope.allPersonInfoNames[index] = res
After this change, nested accordion is not working and first accordion doesn't open and second accordion doesn't generate.
If I set all accrodion to be open, both accordion work correctly, but when when I want open one of them, the problem accur again.
I do this with bootstrap accordion, but have this problem again.