1
如何創建嵌套的UI-Bootstrap手風琴,其內部和外部手風琴彼此獨立工作。如何創建一個嵌套的UI-Bootstrap手風琴?
如果一個手風琴小組在外手風琴中開放,我正在做一些手風琴內功,它不應該影響外手風琴的狀態。以下是我想要實現的示例代碼。
(什麼是現在發生的事情是,如果我在內部手風琴打開一個組, 它關閉父外手風琴組)
<uib-accordion close-others="oneAtATime">
<uib-accordion-group heading="Static Header, initially expanded" is-open="status.isFirstOpen" is-disabled="status.isFirstDisabled">
Below iss the inner accordion
<uib-accordion close-others="oneAtATime">
<uib-accordion-group heading="Static Header, inner accordion" is-open="status.isFirstOpen" is-disabled="status.isFirstDisabled">
This content is straight in the template.
</uib-accordion-group>
<uib-accordion-group heading="{{group.title}}" ng-repeat="group in groups">
{{group.content}}
</uib-accordion-group>
<uib-accordion-group heading="Dynamic Header inner accordion 1t">
<p>The body of the uib-accordion group grows to fit the contents</p>
<button type="button" class="btn btn-default btn-sm" ng-click="addItem()">Add Item</button>
<div ng-repeat="item in items">{{item}}</div>
</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>
我可以對ng-repeat而不是'inner_status'使用多個控制器嗎?但是idk什麼是'is-open'屬性,可能類似'is-open ='status [「item_name」]。open''? – kipris
我不太明白你想做什麼。 'inner_status'應該是一個布爾值,'ng-repeat'爲每個迭代項目創建一個範圍 – svarog
打開手風琴2,然後是任何嵌套的手風琴。 http://plnkr.co/edit/FTPKe9aBsvUWLMaSH5m2?p=preview – kipris