I have created a simple basic app using this tutorial and it seems very convincing and almost working. Few things for you to know before I explain the issue: I understand it is still in beta version so there might be possibilities of bugs and I am very new to ionic and angular
My issue is very simple but its very hard to explain, anyways I will try to put everything all together.
As explained earlier, I have used tutorial mentioned above to create the basic app with 3 pages login, register and dashboard. so I am assuming when a page in ionic loads the angular page hook event is always called, in my case it is ngOnInit and issue is with this event. Here is the steps to recreate my issue and help you understand where I am stuck
- Run the app and first time login page loads and ngOnInit of login page is successfully called.
- I navigate to register page and ngOnInit of register page is successfully called every time I navigate to this page from login.
- In register page there is back button which navigate to login page and when I navigate back to login ngOnInit of login page is NOT called. I want ngOnInit to be called at this point.
- Same thing happens when I navigate to Dashboard page and comes back to login page, login ngOnInit of login page is NOT called. Again I want ngOnInit to be called at this point.
I hope I have made my issue clear.
Now, I am not sure its a bug or not because I don't fully understand how angular works in terms of life cycle hooks and how ionic use angular to make it work.
I have 2 questions now:
Is it a bug? if yes, can anybody please guide me to right direction so I can fix it(which is Impossible ;)) or I can at least notify guys at ionic to fix this.
If its not a bug then please help me understand what am I missing here(an example or guidance would be appreciated), what should I do in order to get ngOnInit be called.
My Version of Ionic
>ionic info
Ionic:
ionic (Ionic CLI) : 4.1.2 (C:\Users\Me\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.12
@angular-devkit/core : 0.7.5
@angular-devkit/schematics : 0.7.5
@angular/cli : 6.1.5
@ionic/ng-toolkit : 1.0.8
@ionic/schematics-angular : 1.0.6
Cordova:
cordova (Cordova CLI) : 8.1.1 ([email protected])
Cordova Platforms : not available
Cordova Plugins : not available
System:
Android SDK Tools : 26.1.1 (C:\Users\Me\AppData\Local\Android\Sdk)
NodeJS : v8.12.0 (C:\Program Files\nodejs\node.exe)
npm : 6.4.1
OS : Windows 10
Thank you in advance
EDIT:
For better understanding of the issue I am trying to point out please see the screenshot below