I have an Ionic 2 app. The premise of the app is to take a class. After the class has been opened, the user is marked as accepting this class in the remote API.
Data stream:
- The user opens the "Classes" tab.
- Requests for Classes applications from the API. Each class has a “status” for this user.
- The user selects a class. This opens up a new look in the app with
NavController.push(Page, { 'classes': classObjFromApi });. - Several pages have been added to the stack, each of which has an object
classes. - The last page of the API reports that the current class has been taken, and the user can return to the root using
NavController.popToRoot()
The status page of each class is displayed on the root page ("Not Running", "Running", "Finished"). At point 5 in the stream above, the user returns to the root, but he has data when they were originally built, which shows the class as “Not Running”, even if it is “completed” now.
How can I update the data on the root page from another page on the stack? I assumed that I popToRoot()would accept navParamsso that I could check the availability of this data on the root page and use it if it exists, or request the API if not.
, API ionViewDidEnter, , API/HTTP- , , , . .
, , , , , .
, : ? , , popToRoot() nav?