Exploring AngularJS and diving into the world of Angular UI Modal found at: http://angular-ui.github.io/bootstrap/.
Searching for a way to create a basic modal with just one close button without needing a separate controller. Is there a simple script like ng-click
event in the modal template that can achieve this? Maybe something like this.close()
...
The desired outcome should resemble this:
Template:
<div class="modal-header">
<h3>Modal header</h3>
</div>
<div class="modal-body">
<h4>Just something random here</h4>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="this.close()">OK</button>
</div>
Page controller:
$scope.openModal = function() {
$uibModal.open({
templateUrl: "modalContent.html",
// aiming for simplicity, hence avoiding an additional controller
//controller: "ModalContentCtrl",
size: '',
backdrop: 'static',
keyboard: false
});
};