I have a link. When user will click in this link, then the page will be reloaded. I did it by the following way......
Html
<div data-ng-hide="backHide" class="offset6 pull-right">
<a href="" data-ng-click="backLinkClick()"><< Back <br/> <br/></a>
</div>
JS
$scope.backLinkClick = function () {
window.location.reload(false);
};
In the controller I have used javascript and that seems to me very bad. How can I do it using angularjs
This question is related to
javascript
angularjs
You can also try this, after injecting $window service.
$window.location.reload();
$scope.rtGo = function(){
$window.sessionStorage.removeItem('message');
$window.sessionStorage.removeItem('status');
}
You need $route defined in your module and change the JS to this.
$scope.backLinkClick = function () {
window.location.reload();
};
that works fine for me.
Source: Stackoverflow.com