有人可以帮助我解决以下情况。

我有一架手风琴,按一下手风琴就会展开。

根据单击的标题,我想加载数据,甚至预加载数据。

我在控制器中具有以下签名的功能

$scope.getDetailsFn = function(Id){
    $scope.Details = "I am possible"
};


手风琴如下

<uib-accordion close-others="oneAtATime" >
   <uib-accordion-group heading="{{x.id}}" ng-repeat="x in xs" >
      //Is the below possible or calling the below on ng-click possible
      {{getDetailsFn({{x.id}})}}
      {{Details}}
      Message: {{x.message}}
      </br>
   </uib-accordion-group>
</uib-accordion>

最佳答案

从您的问题来看,您是否想在单击标题时显示数据?做这个

<uib-accordion close-others="oneAtATime" >
 <uib-accordion-group heading="{{x.id}}" ng-repeat="x in xs" ng-click="getDetailsFn(x.id)">
  {{Details}}
  Message: {{x.message}}
  </br>
 </uib-accordion-group>
</uib-accordion>


在控制器中,您将得到“ x”,因此请根据x显示详细信息。

10-07 21:55