我使用span & ng-repeat創建了一些標記。當用戶點擊任何標籤上的刪除按鈕時,我會打開一個模式彈出窗口。這種模式流行有一個刪除按鈕。這個刪除按鈕又會調用一個函數。在角度應用中將值傳遞到引導程序模式彈出框
我想傳遞一些信息到這個刪除函數,但我不知道如何傳遞刪除按鈕的id到模式彈出出現。
以下是fiddle相同。
<div ng-app>
<div ng-controller="TodoCtrl">
<div ng-app="" ng-init="names=['One','Two','Three']">
<ul>
<li ng-repeat="x in names"> <span class="tag label label-info">
<span>{{x}}</span>
<a data-toggle="modal" data-target="#confirm-delete"><i class="remove glyphicon glyphicon-remove-sign glyphicon-white"></i></a>
</span>
</li>
</ul>
</div>
<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Confirm Delete</h4>
</div>
<div class="modal-body">
<p>You are about to delete one track, this procedure is irreversible.</p>
<p>Do you want to proceed?</p>
<p class="debug-url"></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> <a ng-click="deleteMe()" class="btn btn-danger btn-ok" data-dismiss="modal">Delete</a>
</div>
</div>
</div>
</div>
</div>
</div>
做'NG點擊= 「DELETEME(X)」' – harishr
@entre:每個buttuon將有diferent值。我不知道如何傳遞'x'來刪除按鈕將有助於在這種情況下。 – SharpCoder
請檢查http://stackoverflow.com/questions/10626885/passing-data-to-a-bootstrap-modal –