我正在处理角度并有下一个问题:我有一组手风琴在标题上有一个下拉菜单。我想将最后添加的元素扩展到手风琴组,所以我添加了一个额外的参数_isOpen,当我添加一个新元素时:_isOpen = true。一切正常,但手风琴下降'标题打开以及手风琴。
以下是角度的样子:
<uib-accordion close-others="oneAtATime">
<uib-accordion-group template-url="./custom-template.html" is-open="element._isOpen" ng-repeat="element in rlFull.elements track by element.Id" scroll-glue>
<div class="testing-table" ui-ace="{ onLoad : aceLoaded, mode: 'gherkin', theme: 'chrome'}" ng-model='element.Text' join-steps-array style="height : 200px"></div>
</uib-accordion-group>
</uib-accordion>
部分来自带下拉菜单的模板:
<div class="action-block">
<div uib-dropdown="dropdown" class="dropdown-holder">
<button uib-dropdown-toggle="" class="btn">
Actions
<span class="ico-dropdown"></span>
</button>
<ul role="menu" class="dropdown-menu">
<li>
<a href="" data-ng-click="$parent.element.saveChanges();">Save</a>
</li>
<li>
<a href="" ng-click="$parent.element.deleteElement($parent.element)">Delete</a>
</li>
</ul>
</div>
</div>
答案 0 :(得分:0)
我为uib-dropdown添加了is-open = false,它帮助了我:
<div class="action-block">
<div uib-dropdown="dropdown" class="dropdown-holder" is-open="false">
<button uib-dropdown-toggle="" class="btn">
Actions
<span class="ico-dropdown"></span>
</button>
<ul role="menu" class="dropdown-menu">
<li>
<a href="" data-ng-click="$parent.element.saveChanges();">Save</a>
</li>
<li>
<a href="" ng-click="$parent.element.deleteElement($parent.element)">Delete</a>
</li>
</ul>
</div>
</div>