I have a modal template embedded in the same HTML file as my controller.
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalDeleteItem">Delete selected item</button>
<div class="modal fade" tabindex="-1" role="dialog" id="modalDeleteItem">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title bold">Modal title here</h3>
</div>
<div class="modal-body pd-xlg">
Modal content here
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" ng-click="vm.deleteItem()">Delete</button>
</div>
</div>
</div>
I am unsure how to close the modal within the deleteItem function. How can I access the modal instance within this function?
I do not want to create a separate component for this simple modal. Using $uibModal.open requires passing a templateUrl, but I prefer not to create an individual HTML file for this modal template.