deferred.promise.then().then()异步链式操作(Chain operation)

 1 //deferred.promise.then().then()
 2 
 3 deferred.promise.then(function () {
 4     console.log('1 resolve');
 5      return $q.when();
 6 }, function () {
 7     console.log('1 reject');
 8     return $q.reject();
   // 第二then
9 }).then(function () { 10 console.log('2 resolve'); 11 });

备注:successCallback 和 errorCallback 方法必须返回一个新的 promise,否则第二then默认会执行。

原文地址:https://www.cnblogs.com/niuww/p/11733945.html