I'm new to AngularJS, and were just going through Angular UI Modal described in: http://angular-ui.github.io/bootstrap/.
I want to create a simple modal that have just only one button to close the modal. How to do this without create a separate controller for the modal? Is there a script for ng-click event in the modal template to do the job? Such as this.close()...
What I want to achieve look like 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",
// it's so simple so that I don't want a separate controller
//controller: "ModalContentCtrl",
size: '',
backdrop: 'static',
keyboard: false
});
};
controllercan be a function also - charlietfl