mirror of
https://github.com/moparisthebest/mail
synced 2025-01-30 14:40:13 -05:00
Use promise api for
This commit is contained in:
parent
074914044d
commit
93bd548b46
@ -20,7 +20,9 @@ var AddAccountCtrl = function($scope, $location, $routeParams, $http) {
|
|||||||
var domain = $scope.emailAddress.split('@')[1];
|
var domain = $scope.emailAddress.split('@')[1];
|
||||||
var url = cfg.settingsUrl + domain;
|
var url = cfg.settingsUrl + domain;
|
||||||
|
|
||||||
$http.get(url).success(function(config) {
|
return $http.get(url).then(function(res) {
|
||||||
|
var config = res.data;
|
||||||
|
|
||||||
$scope.busy = false;
|
$scope.busy = false;
|
||||||
$scope.state.login = {
|
$scope.state.login = {
|
||||||
mailConfig: config,
|
mailConfig: config,
|
||||||
@ -39,7 +41,7 @@ var AddAccountCtrl = function($scope, $location, $routeParams, $http) {
|
|||||||
setCredentials();
|
setCredentials();
|
||||||
}
|
}
|
||||||
|
|
||||||
}).error(function() {
|
}).catch(function() {
|
||||||
$scope.busy = false;
|
$scope.busy = false;
|
||||||
$scope.errMsg = 'Error fetching IMAP settings for that email address!';
|
$scope.errMsg = 'Error fetching IMAP settings for that email address!';
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user