I can give some tips for avoiding them.
- always declare types of return values of all functions
- any time you call any function that returns a future (Promise/Observable), make sure one of two things is true: either the calling function returns
voidand everything that needs the resolved value is self-contained inside athenorsubscribein that function; or the very first word of your calling function isreturn - any time you are interacting with cordova, wrap with
platform.ready().then() - ditto with
Storageand itsready() - never use
setTimeout() - if you use any libraries with callback systems,
Promise-ify them and only use that interface - let Angular control the DOM. don't bring in anything (like jQuery) that is going to fight with it