To automatically close a ngDialog
after the successful login, I used the below approach.
HTML template,
<a href="" ng-click="signin()">Log In</a>
<a href="" id="btnClose" ng-click="closeThisDialog()"
style="display:none;">Close</a>
In the controller, the signin
method has the following code to trigger the click event of close button,
$timeout(function () {
var btnClose = document.getElementById('btnClose');
angular.element(btnClose).triggerHandler('click');
}, 0);
Is there any better approach to close the ngDialog
automatically?