Reload The Current State In Ionic 1.x

Posted By Weston Ganger

Using $state.reload() in Ionic doesn't really reload the state as you will find.

Here is a better method to reload the state and not cache the $scope using UI-Router's go function

$state.go($state.current, $stateParams, {reload: true, inherit: false});

Or You can also do this via attributes for a link in html

<pre>
<code class="language-markup">
<a ui-sref="profile" ui-sref-opts="{reload: true, inherit: false}">

<!-- OR with params -->

<a ui-sref="profile({id: user.id})" ui-sref-opts="{reload: true, inherit: false}">


Related External Links:

- [Stack Overflow - angular-js-angular-ui-router-reloading-current-state-refresh-data](http://stackoverflow.com/questions/21714655/angular-js-angular-ui-router-reloading-current-state-refresh-data)
- [Stack Overflow - how-to-put-reload-option-in-ui-sref-markup](http://stackoverflow.com/questions/27690834/how-to-put-reload-option-in-ui-sref-markup)

Article Topic:Software Development - Javascript

Date:December 17, 2015