Refactor buildFromCache() method.

This commit is contained in:
Alexander Zobnin
2016-01-31 16:43:59 +03:00
parent 521e3a2a08
commit 1de4b4bc5c
2 changed files with 134 additions and 111 deletions

View File

@@ -54,7 +54,13 @@ function (angular, _, utils) {
};
p.getGroups = function() {
return this._groups;
var self = this;
if (this._groups) {
return this.refresh().then(function() {
return self._groups;
});
}
return $q.when(this._groups);
};
p.getHosts = function() {