Please tell me why my chained promises results in NULL (pics)

Hi, I have a method with nested promises that returns a promise.

When I call the method followed by ‘then()’ to retrieve the data, it is returned out of order and nulled.

What the heck am I doing wrong?

Thanks in advance.

Nesting promises is an antipattern because it is hard to debug. Chain promises, don’t nest them.

.then().then() <-- ok
.then(.then()) <-- not ok

thanks, actually my code did chain them. I used the wrong terminology.

This should look allot better but it still returns ‘undefined’

Is this the second time in two days I’ve told you something correct about your code and you said I was wrong? You might want to work on that. I won’t be replying to you further, and you will probably burn other people out if you do it to them too.

not at all:) I really do believe my then() calls are chained with the exception of the ready() method. (But that is what ionic has in their storage example.) I’m not being willfully contrarian. If you are not too offended, will you show me where I nested my methods? Also, your example from yesterday returned an undefined.