Software Archive
Read-only legacy content
17061 Discussions

Update entry field display on home page - ionic/angular [RESOLVED]

Geoff_at_CFM
Beginner
319 Views

Another newbie question!

I am using App Designer, Ionic/Angular, with a controller in app.js.

My home page is a form where filter values can be entered by a user, and I save the entered ng-model values into indexedDB, and these filters are used for a REST request on a listings page.

Everything is working except...

When the app starts I get the filter values from the indexedDB and assign these values to my ng-model fields. If I log these values to console I can see that everything has worked, but the page fields don't get updated - UNTIL I click on fields on the page, or go to the listing page and back again. IOW some event is needed to update the display of the values in my filter fields.

Is this some sort of timing issue? Is the page loading before/after I have the values from the DB? What can I do to resolve this? I notice that the latest release of IntelXDK has a function that allows me to easily check for document ready, can I use that to resolve this problem?

TIA!

0 Kudos
2 Replies
Rakshith_K_Intel
Employee
319 Views

can you post your code ?

0 Kudos
Geoff_at_CFM
Beginner
319 Views

Hello Rakshith,

I resolved my problem by calling the timeout function, which refreshed the model variables on the screen...

$timeout(function(){$scope.gotoHome();}, 100);

Is this a reasonable way to refresh the screen?

0 Kudos
Reply