diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts index 6f13f25..4c18159 100644 --- a/src/app/profile/profile.component.ts +++ b/src/app/profile/profile.component.ts @@ -76,6 +76,7 @@ export class Profile { profile: noosferoModels.Profile; constructor(profileService: ProfileService, $stateParams: ng.ui.IStateParamsService) { + profileService.resetCurrentProfile(); profileService.getByIdentifier($stateParams["profile"]).then((response: restangular.IResponse) => { this.profile = response.data[0]; profileService.setCurrentProfile(this.profile); diff --git a/src/lib/ng-noosfero-api/http/profile.service.ts b/src/lib/ng-noosfero-api/http/profile.service.ts index ae06166..3acad69 100644 --- a/src/lib/ng-noosfero-api/http/profile.service.ts +++ b/src/lib/ng-noosfero-api/http/profile.service.ts @@ -7,8 +7,12 @@ export class ProfileService { private _currentProfilePromise: ng.IDeferred; - constructor(private restangular: restangular.IService, $q: ng.IQService) { - this._currentProfilePromise = $q.defer(); + constructor(private restangular: restangular.IService, private $q: ng.IQService) { + this.resetCurrentProfile(); + } + + resetCurrentProfile() { + this._currentProfilePromise = this.$q.defer(); } getCurrentProfile(): ng.IPromise { -- libgit2 0.21.2