I am using AngularStrap with bootstrap.
I have a modal dialog box that uses my own controller. How can I close modal with this local controller?
I create the controller instance with the button:
<button type="button"
class="btn btn-success btn-lg"
bs-modal="modal"
data-template="user-login-modal.html"
data-container="body"
ng-controller="userLoginController"
>Click here to log in</button>
and userLoginController has the following:
$scope.authenticate = function(){
this.hide();
}
This is obviously just a demo version, I want it to close when I log in successfully, but this is where the code I would use to close will be used.
I tried copying modally programmatically (using a modal service to create a modal), but I could not figure out how to enter a controller through this method.
If I were to do something like emit events from a modal using the bs-modal directive, how can I refer to the modal to close it?
plnkr:
http://plnkr.co/edit/m5gT1HiOl1X9poicWIEi?p=preview