0
处理多个分量I有这样的问题:可以折叠
<ng-container *ngFor="let item of list">
<item [content]="item.content" [title]="item.title" [open]="true" (toggleclicked)="/*triggered when a user wants to fold/unfold*/"></item>
</ng-container>
[打开]输入是指示如果我的组件应该被“折叠”或“扩展”是布尔值。是否有一种简单的方法来在ngFor中像这样管理多个组件?
如果我有一个内部状态并自行管理折叠/展开,这是一种更好的做法吗?
我想我可以理解你想要什么。为什么不使用[Bootstrap可折叠项目](http://getbootstrap.com/javascript/#collapse)? – trichetriche
我对bootstrap了解不多,而且我还需要能够拥有诸如toggleAll()的控件 – HaneTV
这非常简单,您可以使用Jquery的3行完成toggleAll()函数 – trichetriche