Wednesday 15 August 2012

angularjs - Collapse fails to update with dynamic ng-repeat -



angularjs - Collapse fails to update with dynamic ng-repeat -

i have simple collapse.

<ul collapse="iscollapsed"> <li ng-repeat="item in items"> {{item}} </li> </ul>

here controller:

angular.module('ui.bootstrap.demo').controller('collapsedemoctrl', function ($scope) { $scope.iscollapsed = true; $scope.items = []; $scope.add = function() { $scope.items.push(math.random()); } });

http://plnkr.co/edit/zye3a4gt2i3jzgoexxhf?p=preview

when toggle iscollapsed true false , add together more items list, collapse height not updated. not happen when iscollapsed initialized false or when toggle collapse again.

i'm not sure if it's bug or works expected.

edit: problem when toggle iscollapsed false, if there no item (height: 0px), collapse not set height attr auto, create collapse update height.

it confirmed bug. please refer github issue https://github.com/angular-ui/bootstrap/issues/2836

angularjs angularjs-ng-repeat angular-ui-bootstrap

No comments:

Post a Comment