From 83a5109c108956d6b0fb1b9bfbc228672da4d729 Mon Sep 17 00:00:00 2001 From: reyraa Date: Fri, 9 Jun 2017 10:56:09 +0200 Subject: [PATCH 1/3] Hide modal in cancel method --- src/components/delegateRegistration/delegateRegistration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/delegateRegistration/delegateRegistration.js b/src/components/delegateRegistration/delegateRegistration.js index f4327d1d3..1018def89 100644 --- a/src/components/delegateRegistration/delegateRegistration.js +++ b/src/components/delegateRegistration/delegateRegistration.js @@ -74,7 +74,7 @@ app.component('delegateRegistration', { */ $scope.cancel = (form) => { $scope.reset(form); - // $mdDialog.hide(); + $mdDialog.hide(); }; }, }); From 42c0d0b92ba07513e02c6b9e5d64985bcf2bc685 Mon Sep 17 00:00:00 2001 From: reyraa Date: Fri, 9 Jun 2017 12:20:45 +0200 Subject: [PATCH 2/3] Use dialog service for closing the modal and remove mdDialog from dependency list --- .../delegateRegistration/delegateRegistration.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/delegateRegistration/delegateRegistration.js b/src/components/delegateRegistration/delegateRegistration.js index 1018def89..22e9ae3d7 100644 --- a/src/components/delegateRegistration/delegateRegistration.js +++ b/src/components/delegateRegistration/delegateRegistration.js @@ -8,7 +8,10 @@ import './delegateRegistration.less'; */ app.component('delegateRegistration', { template: require('./delegateRegistration.pug')(), - controller($scope, $mdDialog, delegateApi, Account, dialog, $rootScope) { + bindings: { + closeDialog: '&', + }, + controller($scope, delegateApi, Account, dialog, $rootScope) { function checkPendingRegistration() { delegateApi.getDelegate({ username: $scope.username, @@ -74,7 +77,7 @@ app.component('delegateRegistration', { */ $scope.cancel = (form) => { $scope.reset(form); - $mdDialog.hide(); + this.closeDialog(); }; }, }); From 53b7212b825dde618978b5f1023ddcf88d3db6c0 Mon Sep 17 00:00:00 2001 From: reyraa Date: Fri, 9 Jun 2017 12:31:02 +0200 Subject: [PATCH 3/3] Minor fixings --- src/components/delegateRegistration/delegateRegistration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/delegateRegistration/delegateRegistration.js b/src/components/delegateRegistration/delegateRegistration.js index 22e9ae3d7..a1d230e57 100644 --- a/src/components/delegateRegistration/delegateRegistration.js +++ b/src/components/delegateRegistration/delegateRegistration.js @@ -45,7 +45,7 @@ app.component('delegateRegistration', { checkPendingRegistration(); }); $scope.reset(form); - $mdDialog.hide(); + this.closeDialog(); }); }) .catch((error) => {