angularjs - Automatically close ngDialog -
to automatically close ngdialog
after successful login, used 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 controller, signin
method has following code trigger click event of close button,
$timeout(function () { var btnclose = document.getelementbyid('btnclose'); angular.element(btnclose).triggerhandler('click'); }, 0);
is there better approach close ngdialog
automatically?
you can simple use closethisdialog below in signin method. close dialog after click log in button.
$scope.signin = function() { $scope.closethisdialog(); };
Comments
Post a Comment