我正在關注blur admin UI以單擊按鈕後顯示警報。但是,當我點擊關閉按鈕時,關閉的警報消息不會關閉。angularjs closeable div單擊後不會關閉
我希望能夠關閉警報消息並轉向s cope.added = false
。 請幫忙嗎?
這裏是我的代碼看起來是這樣的:
<div ng-show="added" class="alert bg-success closeable" role="alert">
<button type="button" class="close" aria-label="Close"><span
aria-hidden="true">×</span></button>
<strong>Added</strong> Successfully!
</div>
<div style="text-align: center">
<button type="submit" ng-click="display()"
class="btn btn-danger">add
</button>
</div>
在JS:
在HTML$scope.added = false;
$scope.display= function() {
$scope.added = true;
}
感謝
您的第一個按鈕需要有一個可以在布爾標誌設置爲false,這將導致隱藏整個DIV塊點擊功能。 –