我是棱角分明的新手,我正在尝试使用uib-accordian中的ng-repeat。单击每个标题后,后续项目将打开并显示其用户。
但是我希望默认情况下第一个项目是打开的(也就是说,默认情况下将第一个项目传递给展开(项目))
我试过is-open = $ first。虽然第一个项目是开放的,但用户不会显示。
<uib-accordian close-others="oneAtATime">
<div uib-accordian-group class="panel-default" ng-repeat="project in projects">
<uib-accordian-heading><span ng-click="expanded(project)">{{project.name}}</span></uib-accordian-heading>
<div ng-repeat="user in project.users">
//
</div>
</div>
</uib-accordian>
答案 0 :(得分:0)
您可以像这样使用 is-open :
<uib-accordian close-others="oneAtATime">
<div is-open="($index==0)" uib-accordian-group class="panel-default" ng-repeat="project in projects">
<uib-accordian-heading><span ng-click="expanded(project)">{{project.name}}</span></uib-accordian-heading>
<div ng-repeat="user in project.users">
//
</div>
</div>
</uib-accordian>