I noticed this problem this morning as well. Here are two descriptions of problems that I feel are the same issue.
Loading a list of items is empty. When I click on the menu toggle, my data suddenly appears on the view.
When I call nav.push(NewPage) the call is fired, and doesn’t error, but no page transition occurs. If I click the button that causes the transition again, it will load the new view, but it has stacked the view twice now in my nav history.
In the case of the second instance I have verified that the call to nav.push() never returns a result from the promise on that first click.
Perhaps something in the way I upgraded the project to beta 4 is causing issues with promises that are supposed to cause view updates?
cli: beta 24
ionic-angular: beta4
used pinned tutorial to update from beta3 to beta4
Also note the user of NgZone here. This is a weird one, but since we are initially setting our items array to blank, and then (slightly) later setting it to whatever is in storage, our list won’t update. It’s already set and the Angular UI does not know that it needs to be updated. By running our load code inside of zone.run we are letting Angular know that the UI needs to be updated. If you do not do this, your list data won’t show up until you click or interact with the UI in some way.
Thank you I got more info.
But before the beta 4 I had not this weird one … I didn’t use NgZone and all worked fine.
I updated, my project, to the beta 4 without any changes and now Angular don’t know that the UI needs to be updated.
And not my project only, I tried with a tutorial project of Ionic2 and I got the same issue.
I had the same issue, using NgZone is what fixed it. I don’t know why it wasn’t needed before and why it is now, or if there is a better way to go about it, or if this is just a bug, but using NgZone will solve the problem.
Josh, could you confirm if this is expected behaviour? As in Angular2, I understood that any change to a models value would update immediately in the view, whenever that may happen at runtime.
@iborik I just tried with a new Ionic 2 project - ionic start Test blank --v2 --ts - and updated it with the code from the plunker test environment and everything works as expected. Maybe it’s something with the configuration or with the build process, as @marcmeans suggested. Do you test in the browser or emulator/device and do you get any errors in the console?
@iignatov the plunker test environment is not a good example because each call updates the previous one or something like that. I tried it without any change and everything was good.
But if you test each call one by one by commenting others you wont get the view updated.
That’s my problem, I need to do an other action to get my view updated and with the plunker test that’s a little bit like that because you do several actions and I think it updates the view at one moment.
@iborik Ok, thanks for the clarification. I created a new test environment which allows to run only a single test at a time. I retried all the tests and they are all working as expected. When I try the same thing with my test project locally then the platform test (i.e. platform.ready().then()) is not working. Do you experience the same, i.e. does only the platform test fail or all of them?
@nanexcool Yes, the plunker is using TS. In JS this is not a valid syntax. If you for whatever reason want to use types and class properties in JS code you can use the workaround from this post: