I’ve started experimenting with ionic2. I built a simple app, with navigation between pages, several layouts, menu etc. I hooked everything up and used the http module to get data for the views from an API.
I then added a login page as the rootview. After successfully logging in I set my root to my homepage.
The authentication works, so does the app and the API calls. Everything together does not.
I’m using authentication via Facebook. I use the InAppBrowser plugin to achieve this as my API was already set up to do the whole oAuth redirect dance. The API correctly creates a session and sends back a token which I then strip out of the URL and store locally. After that I close the inAppBrowser and set the root page. That page request more data from the API and successfully updates the model, yet the view remain blank.
I tested this without the login page, setting the homepage as root directly and that works, but when I try to use with the login first, it doesn’t update.
I’ll try the async pipe, I was already using observables and it didn’t work. I’ve just done a quick test, I refactored the api call to only request data on clicking a button. This way it works, but if call the api on the constructor or any of the onInit funcs, it doesn’t update the view. So yes, most likely a problem with angular zone.
I’ll try async first thing tomorrow morning. Get back to you then