I\'m looking at this example from Angular\'s docs for $q but I think this probably applies to promises in general. The example below is copied verbatim from the
.then function of promiseB receives what is returned from .then function of promiseA.
here promiseA is returning is a number, which will be available as number parameter in success function of promiseB. which will then be incremented by 1