UX frozen during app init - are promises inherently async?


#1

My app is sometimes unresponsive on load - sometimes I can’t scroll or open the side-menu. It seems like the UX is frozen until the background processing is complete.

I do the following on startup:

  1. ParseJS call to get albums,
  2. ParseJS calls to get albumPhotos
  3. filter photos in controller
  4. render an image gallery in view with the the collection-repeat directive
  5. IMG.src = FILE_URI images stored in
    cordova.file.applicationStorageDirectory

The backend calls using ParseJS calls all use promises and are wrapped inside a $timeout.

Is there something else I can do to get back to the main javascript UI thread so that it will be more responsive?


#2

I think there is on need to call $timeout because you are not in a native-event context.

But you should keep in mind that ui-elements are working correctly after ionic.Platform.ready.
http://ionicframework.com/docs/api/utility/ionic.Platform/

I am using a nodejs backend and my app sends multiple requests also (competitive ones) and nothing freezes.

Mabye you can build a codepen for that?