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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -