I want to reload the controller I'm linking to in a menu in an ionic angular app. How do I declare the link in the markup so that it refreshes the destination route every time the link is clicked?
I saw this bit of code
$state.go($state.current, {}, {reload: true});
Which I suppose I can wrap in a controller method but I would prefer to do it in the markup if possible.
Wrap it in a function in your controller:
$scope.reload = function () {
$state.go($state.current, {}, { reload: true });
}
Then use it in your view:
<button ng-click="reload()">Reload</button>