如何使用Angularjs重新加载页面? [英] How to reload a page using Angularjs?
本文介绍了如何使用Angularjs重新加载页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个链接.当用户单击此链接时,页面将被重新加载.我是通过以下方式做到的……
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);
};
在控制器中,我使用了JavaScript,在我看来,这非常糟糕.如何使用 angularjs
In the controller I have used javascript and that seems to me very bad. How can I do it using angularjs
推荐答案
请确保将$ route服务包含在您的范围内,并执行以下操作:
Be sure to include the $route service into your scope and do this:
$route.reload();
看到这个:
这篇关于如何使用Angularjs重新加载页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文