I just implemented my first function that returns a promise based on another promise in AngularJS, and it worked. But before I decided to just do it, I spent 2 hour
For the simplicity to understand about the promises in Javascript. You can refer below example. Just copy paste in a new php/html file and run.