Reputation: 237
I want to close the modal with the "Cancel" button
open the modal , in the controller:
$scope.newTransaction = function(){
var modalInstance = $modal.open({
templateUrl: 'tpl/transactions/modal/new_transaction.html'
});
};
the modal :
<div ng-controller="TransactionsCtrl">
<div class="modal-header bg-success">
<h3 class="modal-title">New Transaction</h3>
</div>
<div class="modal-body" style="height: 500px;">
<iframe ng-src="{{mylink_newTransaction}}" height="100%" width="100%" frameBorder="0">
</iframe>
</div>
<div class="modal-footer bg-light">
<button class="btn btn-default">Cancel</button>
<button class="btn btn-success">Create</button>
</div>
</div>
thanks for the help!
Upvotes: 0
Views: 4342
Reputation: 125591
The documentation uses: ng-click="cancel()"
So in your case the button should look like this:
<button class="btn btn-default" ng-click="cancel()>Cancel</button>
plunker (from same documentation)
Upvotes: 0
Reputation: 93
Just add a data-dismiss
attribute:
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
Upvotes: 0