Force "reloading" page when navigate to same route with different params



I have a Component linked to a route with an id param:
{ path: 'te/:id', component: AComponent },

If I add a link from page AComponent with param “a” to a page AComponent with param “b” (same component, just change param), the method “ngAfterViewInit” and “ngAfterContentInit” are not called.

First question: is it a normal behavior ?
Second question: is it a way to force “reloading” page (an go through ngAfterViewInit and ngAfterContentInit) ?

Thanks !


I’m not sure what are you trying to achieve, but if you want to run a function whenever a user navigates from page A to page B or from Page B to page A, you can do something like:

import { Page } from 'ui/page'

export class ComponentA { 
 constructor(private page: Page) {
  //when user navigates to this component"navigatedTo", () => {
  //Do Something


Page is reused in nativescript-angular, so the ng lifecycles doesn’t always match.

See this issue


Thanks for your answer but I find the solution! It"s a pure angular question: In angular you can choose to reload page (ie recreate the component) when paramters changes, but it is not the default behavior (default behavior is to keep component to improve performance).

For more information you can take a look at this links:


ListView does not refresh/update when a new value is added

You can also just reload the params using forEach:

constructor(private route: ActivatedRoute) {

ngOnInit() {
    .forEach(params => {
// This will be triggered every time the params change
// Add your code to reload here. i.e.
      const tech = params['tech'];
      const keyword = params['keyword'];

      this.searchArticles(tech, keyword);


Won’t that break with the page-outlet-router?


As far as I remember, this should still work.


It doesn’t seem to work with NS RouterExtensions to me …


Hi @TheOnlyMatt,
Can you recreate your example in
I can have a look at the code.