简体   繁体   English

Meteorjs + Angular2单击链接不会重新呈现页面

[英]Meteorjs + Angular2 click link does not re-render page

Using MeteorJS and Angular 2.0 使用MeteorJSAngular 2.0

On home page that has a link called Login . 在主页上有一个名为Login的链接。

When clicked, user is routed to login page, and associated Angular2 Components are rendered correctly. 单击后,用户将被路由到登录页面,并且正确渲染了关联的Angular2组件。

Now on login page, which has a link to return to home page. 现在在登录页面上,该页面具有返回首页的链接。

Click on link and navigate to home page, then re-click login page. 单击链接并导航到主页,然后重新单击登录页面。

User is routed correctly, but Angular2 Components do not re-render. 用户的路由正确,但是Angular2组件不会重新渲染。

You were looking for known issues on templates and reloading pages. 您正在寻找模板和重新加载页面上的已知问题。 One issue is about templates being mixed in cache, which is fixed with clearing the cache as follows: 一个问题是有关模板混入缓存中的问题,该问题已通过清除缓存来解决,如下所示:

var currentPageTemplate = $route.current.templateUrl;
$templateCache.remove(currentPageTemplate);
$route.reload();

Source: 资源:

Angular reload current route and reload the current template Angular重新加载当前路线并重新加载当前模板

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM