-
Improvement
-
Resolution: Fixed
-
Minor
-
2.1
-
-
MOODLE_21_STABLE
-
MOODLE_21_STABLE
As discussed on MOBILE-831, we need an app init process to be able to know the app is initialized. Fred comments about this:
- Creating a place where we can register init process
- Those init process need to return promises
- All those init processes need to be registered before the following:
- An event is triggered once all the init process have been resolved/rejected
I believe we cannot limit the init processes to .config(), and .run() is pretty async so it's hard to predict when our 'checkInit' needs to be run. But for sure we need to register at least one init process before we call 'checkInit', and once checkInit is finished we need to go through the init processes to see if any new one was added. The init processes need to register a function which will return a promise, they should not call the promise straight. 'checkInit' will trigger an event resolving the promise of $mmApp.ready(), or $mmApp.initialised() or something.