Presenting my factory below:
.factory('UserData', ['User', '$q', function(User, $q) {
var deferred = $q.defer();
return {
user: null,
get: function() {
var _this = this;
_this.user = User.get();
deferred.resolve(User.get());
return deferred.promise();
}
};
}]);
In the User factory, there is some relevant data available which can be retrieved using User.get()
.
My goal is to retrieve this data and assign it to user: null
in my UserData factory.