JavaScript AngularJS : How do I execute an array of defered in order?

I have an array of async functions, where it only makes sense to run one if the previous one has been resolved. You can think of them as HTT get requests to different URL, e.g.

$http.get('/step1')
$http.get('/step2')
$http.get('/step3')
$http.get('/step4')

How can I serialize them?

EDIT: There are N of them in an array. So I can't explicitly unroll them and join them with 'then', e.g.:

var calls = Array()

for(var i = 0; i < N; i++)
{
    var d = $q.defer();

    ...

    calls.push(d.promise);
}

..

// How to do resolve the elements of 'calls' in order?

EDIT 2:

I would like:

Running Step #0 
Step completed: #0 OK 
Running Step #1 
Step completed: #1 OK 
Running Step #2 
Step completed: #2 OK 
Running Step #3 
Step completed: #3 OK 
Running Step #4 
Step completed: #4 OK 
Running Step #5 
Step completed: #5 OK 

Not

Running Step #0 
Running Step #1 
Running Step #2 
Running Step #3 
Running Step #4 
Running Step #5 
Step completed: #0 OK 
Step completed: #1 OK 
Step completed: #2 OK 
Step completed: #3 OK 
Step completed: #4 OK 
Step completed: #5 OK 
Answer:1

Using lodash for brevity.

_.reduce(_.rest(calls), function(promise, call) {
  return promise.then(function() {
    return call();
  });
}, _.first(calls)()).then(function() {
  // do something after they are all done sequentially.
});
Answer:2

I have a filedset and legend inside that with "some text" and inside this fieldset i have a GRID I have 2 questions How to show ? hide html filedset from code behind, i tried the following way to ...

I have a filedset and legend inside that with "some text" and inside this fieldset i have a GRID I have 2 questions How to show ? hide html filedset from code behind, i tried the following way to ...

  1. show hide html element
  2. show hide html element based on checkbox control
  3. show hide html element jquery
  4. show hide html elements using jquery
  5. show hide html css
  6. show hide html code
  7. show hide html button
  8. show hide html table using javascript
  9. show hide html
  10. show/hide html table columns using css
  11. show hide html javascript
  12. show hide html label javascript
  13. show hide html div
  14. show hide html element angular
  15. show hide html jquery
  16. show hide html element css
  17. show hide html control using javascript
  18. show hide html table
  19. show hide html attribute
  20. show hide html table rows

This is the link that I have: href='" . $ajax_like_link . "' data-task='like' data-post_id='" . $post_id . "' data-nonce='" . $nonce . "'>"; And I want to replace the displayed link value from ...

This is the link that I have: href='" . $ajax_like_link . "' data-task='like' data-post_id='" . $post_id . "' data-nonce='" . $nonce . "'>"; And I want to replace the displayed link value from ...

I have a for loop in php that adds a number of checkboxes on my page that look like this <input type="checkbox" name="checkbox[]"> I want to use javascript to check which is checked and add ...

I have a for loop in php that adds a number of checkboxes on my page that look like this <input type="checkbox" name="checkbox[]"> I want to use javascript to check which is checked and add ...

  1. remove some values from array php
  2. find some values in array

I wanted Two Google Maps API in single html file. SO I have done like following. But it is not working. Please help me by guiding why I cant and where I am mistaking? Thanks in advance. <html&...

I wanted Two Google Maps API in single html file. SO I have done like following. But it is not working. Please help me by guiding why I cant and where I am mistaking? Thanks in advance. <html&...

  1. longest possible google maps route
  2. longest possible drive google maps