Ajax成功vs然后(角度承诺)
答
1. advantages of promises is the ability to flatten and chain potentially complex sequences of ajax calls. Not only does this help us simplify code, but more importantly, it helps us manage timing and dependencies through a sequence of calls.
2. The fundamental difference between 'success' and 'then' is that success will return the original promise instead of returning a new derived promise. Each then() invocation returns a fresh promise – which is key to chaining multiple promise calls.
详细差check here
可能重复http://*.com/questions/16385278/angular-httppromise-difference-between-success-的error-methods-and-thens-a –
[Angular HttpPromise:\'success \'/ \'error \'methods和\'然后\''参数之间的区别]的可能副本(http://*.com/问题/ 16385278 /角httppromise差之间成功 - 误差的方法和 - thens-a)的 –