我有一个返回应用程序数组的 http.get
<div id ="app" ng-repeat="app in applications" >
<carddata-toggle="modal" data-target="#myModal" ></card>
</div>
对于他们每个人,我都创建了一张卡片(自定义指令......想想谷歌现在卡片)并向他们添加一个引导模式。这个想法是您可以单击每张卡片并获取有关该特定应用程序的更多信息。
在我的模态代码中,我想检索有关应用程序的信息(例如应用程序名称)。由于这在 for 循环之外,Angular 已经丢失了我的应用程序名称,因此会引发错误。
<div class="modal modal-fullscreen fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">{{app.name}} Status</h4>
</div>
我已经通读了 angular Api ... 我正在寻找一种将应用程序名称“绑定”到模态的方法,以便它知道它,但看不到任何合适的东西。我是 Angular 的新手,因此我可能没有正确地接近它。
你会如何处理这个问题?