$q.reject and handling errors in AngularJS chained promises
I'm having trouble understanding a basic concept of error handling with chaining promises. In order to learn the rules, I have written a simple example, guessing what the result will be. But unfortunatly it doesn't behave as I though it will. I have read multiple articles about the subject but perhaps can't I get details because of my poor english language. Anyway, here is my code : var promiseStart = $q.when("start"); var promise1 = promiseStart.then(function() { return Serviceforpromise1.get(); }); var promise2 = promise1.then(function(data1) { return Serviceforpromise2.get(data1); }