Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

angular typescript refresh page

this.router.routeReuseStrategy.shouldReuseRoute = function(){
            return false;
         };
this.router.events.subscribe((evt) => {
            if (evt instanceof NavigationEnd) {
               // trick the Router into believing it's last link wasn't previously loaded
               this.router.navigated = false;
               // if you need to scroll back to top, here is the right place
               window.scrollTo(0, 0);
            }
        });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #typescript #refresh #page
ADD COMMENT
Topic
Name
2+7 =