Ionic 4 beta how to fire constructor on navigating to same route?

Hi,

I’m using Ionic 4 latest beta version and all my pages and components are lazy loaded.
I have a component called “EntriesComponent” that in its ngOnInit function I get data from an endpoint, and everything works fine.

Problem is, when I’m already in my EntriesComponent view ( route ) and I want to navigate to it again, the component’s ngOnInit function won’t fire also the constructor.

import { Component, OnInit } from '@angular/core';
import Entry from '../../models/entry';
import { AuthService } from '../../services/auth/auth.service';

@Component({
  selector: 'app-entries',
  templateUrl: './entries.component.html',
  styleUrls: ['./entries.component.scss']
})
export class EntriesComponent implements OnInit {

  entries: Array<Entry> = [];

  constructor(private authService: AuthService) {
  }

  ngOnInit() {
    this.authService.entries().subscribe((data: Array<Entry>) => {
      this.entries = data;
      console.log(data);
    });
  }

}

How can I navigate to same route and fire constructor to get my data from the endpoint.

Use the ionViewWillEnter event instead?

That doesn’t work either.
ionViewWillEnter also behaves like constructor and ngOnInit function.

you could use ngAfterViewInit or ionViewDidEnter, this event is fired anytime the view enter.

That doesn’t work either.

I don’t think pages are the right place to be worrying about this. I would modify authService instead to deliver new information as it comes in, at which point as long as the subscription is active, EntriesComponent will be up to date.