Search code examples
javascriptangularjsmeteorweb-component

Meteorjs + Angular2 click link does not re-render page


Using MeteorJS and Angular 2.0

On home page that has a link called Login.

When clicked, user is routed to login page, and associated Angular2 Components are rendered correctly.

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.


Solution

  • 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