I’ve got an application that retrieves data from a promise object when it is loaded. In the browser (ionic serve) I can correctly display them. On the mobile device (ionic run android) I can only show it, after I leave that view and go back to that view again.
I tried to refresh the view every 2 seconds. But it doesn’t help. I have to go out of the view (via the menu) to another view and then go back to my home view.
Humm…It’s hard for me to do it right now, since the app retrieves data from couchDB and stuff. Any other idea I could try out would be much appreciated. For example is it possible to “simulte” the go-out-from-homve-view-and-go-back-to-home-view-again?
I would suggest replacing your current method with a simple resolve and an mock object, if that resolves and displays correctly then you know it’s specifically a couchDB issue and can focus on resolving that.
If you are updating data on couchDB and expecting it to update the view without going back and in again, the problem is the expectation of the resolve.
Once a promise has resolved it will always return the data it initially resolved with unless you clear the original promise, which happens when you come out of the state and back in.
Is that a better description of the problem you are experience?
Hummm…it works in the browser and I can retrieve the data (but have to leave the home view first). So, I don’t think there’s a problem with couchDB. But thanks for the suggestion.
I just ran my code in Firefox and in Chromium. On Chromium it would work. On Firefox it wouldn’t. It would throw me this error: Object { message: “InvalidStateError”, name: “error” }
Has anyone experienced that too? What’s the explanation for that?
Also it’s important to note firefox isn’t fully supported by Ionic.
I see. Then it doesn’t make sense to debug the app on FF, right?
What are you using to trigger the state change?
Simply AngularJS: “$scope.questioncatalogs” is tied bidirectionally to “qcs” with $scope.questioncatalogs = qcs. Whenever qcs changes $scope.questioncatalogs will change and the view will be updated via the following code: