[SOLVED] How to reload state afer changing picture

Hi all

Quick facts: User takes a new profile picture. Same Picturename (caching problem, profileid.jpg) - Trying to reload the state to display the new picutre.

This works:
$state.go(‘app.settings’, {id: profileId}, { reload: true, inherit: false, notify: true });

This dosn’t works:
$state.go('app.settings', {id: profileId});

In the second try my navbar is hidden and some parts of the layxout are destoryed.

I’ve also tried it by using a timestamp like

$scope.timestamp = new Date().getTime(); and reset $scope.timestamp after taking the picture.

The View:
<div class="profilepic" ng-click="takeAPicture()" style="background-image:url('{{dataDirectory}}/{currentProfile.picture}}?revision={{timestamp}}');"></div>

Maybe someone can help me to refresh the picture? Any ideas?


add this one
$state.go($state.current, {}, {reload: true});

Thanks @nitishrajput01, thats near to my working example (with reload).

Do i need a reload or do i have another way to display the new image?


yes you need to reload your state another method is you can use ion-refresher


Thanks for your support.