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
void
and everything that needs the resolved value is self-contained inside athen
orsubscribe
in 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
Storage
and 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