これが「確認ダイアログ」の処理方法です(ブートストラップを使用)
マークアップ
<div class="alert alert-block alert-error notification fade in" data-ng-show="displayLocationDeletePopup">
<h6>Are you sure you want to delete this location?</h6>
<div class="form-controls-alert">
<a href="" class="btn" data-ng-click="showDeleteLocationPopup(false)">No</a>
<a href="" class="btn btn-danger" data-ng-click="deleteVendorLocation(locationId)">Yes</a>
</div>
</div><!-- end alert -->
コントローラのロード時にモデルをfalseに設定すると、デフォルトで非表示になります。ng-show
$scope.displayLocationDeletePopup = false;
ショーポップアップのイベントをクリックすると、関数を呼び出します/でモデルを渡します
<i class="icon-remove" data-ng-click="showDeleteLocationPopup(true, location)"></i>
コントローラ内:
$scope.showDeleteLocationPopup = function(options, id) {
if (options === true) {
$scope.displayLocationDeletePopup = true;
} else {
$scope.displayLocationDeletePopup = false;
}
$scope.locationId = id;
};
そして、上記のhtmlのアンカーごとに、ポップアップを閉じるか、関数を実行できます
$scope.deleteVendorLocation = function (storeLocation) {
// Code to run on confirmation
};