简体   繁体   中英

AngularJS - Possible to ng-show/ng-hide a modal window?

I want to keep the state of my bootstrap.ui (OR ngdialog!!) modal window when it is closed. Any idea how I might ng-show/ng-hide a modal window?

Thanks.

Look this example:

 <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css"> <div ng-app> <div ng-init="showModal=false"> <button class="btn btn-primary btn-lg" ng-click="showModal = !showModal"> Launch demo modal </button> <div class="modal fade in" aria-hidden="false" style="display: block;" ng-show="showModal"> <div class="modal-dialog"> <div class="modal-content"> MODAL <div class="modal-footer"> <button type="button" class="btn btn-primary" ng-click="showModal=false">Ok</button> </div> </div> </div> </div> </div> </div> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM