我必须做出一系列fetch()Promise:我一次只有 1 个 url,这意味着只有 1 个fetch()Promise。每次我收到一个 json,这个包含另一个 json 的 url,所以我必须做出另一个fetch()Promise。
我可以处理多个Promise,但在这种情况下我不能这样做Promise.all(),因为我没有所有的 url,而只有一个。
这个例子不起作用,它都冻结了。
function fetchNextJson(json_url) 
{
    return fetch(json_url, {
            method: 'get'
        })
        .then(function(response) {
            return response.json();
        })
        .then(function(json) {
            console.log(json);
            return json;
        })
        .catch(function(err) {
            console.log('error: ' + error);
        });
}
function getItems(next_json_url) 
{
    if (!(next_json_url)) return;
    get_items = fetchNextJson(next_json_url);
    interval = $q.when(get_items).then(function(response) {
        console.log(response);
        next_json_url = response.Pagination.NextPage.Href;
    });
    getItems(next_json_url);
}
var next_json_url = 'http://localhost:3000/one';
getItems(next_json_url);