[英]angular ui-router reload with Javascript widget
Making a doctor's website with Angular ui-router which switches partials through ui-sref. 用Angular ui-router制作医生的网站,它通过ui-sref切换局部。 I need the ui-sref link to reload on the pages with the javascript widgets so they upload.
我需要ui-sref链接以使用javascript小部件在页面上重新加载,以便它们上载。 Here is the view:
这是视图:
<a ui-sref="home">
and the state router in the js file: 以及js文件中的状态路由器:
.state('home', {
url: '/home',
templateUrl: 'Partials/partial-home.html'
})
I tried: 我试过了:
ui-sref-opts="{reload: true}"
in my ui-sref but it did not reload the widget. 在我的ui-sref中,但它没有重新加载小部件。 I tried other code I found here and that didn't help either.
我尝试了在这里找到的其他代码,但也没有帮助。 Here is the source code for anyone who wants to see: https://github.com/EBM26
这是任何想看的人的源代码: https : //github.com/EBM26
If you want to force the reload on the view, I would just do it on the controller. 如果要在视图上强制重新加载,我只需在控制器上执行即可。 This breaks the whole point of a SPA.
这打破了SPA的重点。
See this question. 看到这个问题。 "ui-sref" does not refresh the "ui-view"(its controller does not rerun) when a link is clicked twice
两次单击链接后,“ ui-sref”不会刷新“ ui-view”(其控制器不会重新运行)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.