I have a angular ui modal. In that there is a button.On clicking this button I want to open another modal in angular ui.how can i do this
$scope.open = function () {
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
})
};
myModalContent.html contains a button on clicking which I want to open another modal.
<a class="btn btn-success" href="#" role="button" ng-click="openModal()">Open modal</a>
I am unable to open a modal on clicking the button
You can easily open a second modal
var modalInstanceSecond = $modal.open({
templateUrl: 'mySecondModalContent.html',
controller: 'ModalInstanceCtrl',
});
Take a look at this plunker:
http://plnkr.co/edit/vfWJogYvMFFL2XcvM0pJ?p=preview
and also this sample
$scope.open = function () {
$scope.insideModalOpen = $modal.open({
templateUrl: 'myInsideModal.html',
controller: insideModalInstanceCtrl
});
var modalInstance = $modal.open({
templateUrl: 'myModalContent.html',
controller: ModalInstanceCtrl,
resolve : {
params : function(){
return {
insideModalOpen : function(){
$scope.insideModalOpen();
}
};
}
}
})
};