0
我有我的模式設置爲使角UI引導模式按鈕將不執行功能
<script type="text/ng-template" id="myModalContent.html">
<div class="modal-header">
<h3 class="modal-title">Confirm</h3>
</div>
<div class="modal-body">
<p>Are you sure you want to remove Two Factor Authentication from your profile?</p>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="removeSetting()">Yes</button>
<button class="btn btn-warning" ng-click="$dismiss()">Cancel</button>
</div>
</script>
擊中取消按鈕做什麼它應該直接關閉模式。我的問題出現在用戶點擊yes按鈕時。我的功能removeSetting()
從未得到執行。
$scope.removeSetting = function() {
TwoFactorAuthenticationService.removetAuthetication().then(function(data) {
$scope.busy3=false;
notifyService.alert("error", notifyService.getAlertText('2FactorRemovedToken'));
$scope.busy=true;
$timeout(function() {
$scope.templateUrl = 'twofactorsetup/step1.html';
}, 3000);
}, function() {
notifyService.alert("error", notifyService.getAlertText('2FactorRemoveTokenFailed'));
});
};
這是應該調用和執行的函數。我錯過了什麼?在模式
是該功能被擊中或不使用呼叫功能從父範圍從這樣的模板?你有沒有放置任何'調試器',看看? –
是範圍函數(嘗試在templa中顯示removeSetting變量) 如果在範圍內,它是否進入它(在開始時添加日誌) - 可以有例如。承諾或缺少$的某些問題適用於結果函數。很難猜到 – farincz
你是如何打開你的模態?你在你的模式中給了哪個控制器?它的功能是什麼? –