Problem with callback used in LocalStorage

I’m trying to do a class to CRUD with LocalStorage (because the SqlStorage is not working on Windows Mobile), I’m having trouble with the asynchronous methods.

The initial idea is take the data of my LocalStorage where I have for example:

tbl_acc_id_1
tbl_acc_description_1

tbl_acc_id_2
tbl_acc_description_2

And turn into an array containing all my accounts:
{
0: {’ id ': ’ 1 ', ’ description ': ’ myAccount Example ‘},
1: {’ id ': ’ 2 ', ’ description ': ’ myAccount Example Other}
}

I tried the following:

list(success)
{
    let all = [];

    this.getLast((data) => 
    {
        for(var i = 1; i <= this.last; i++)
        {
            this.select(i, (item) => 
            {
                all.push(item);
            });
        }
        console.debug(JSON.stringify(all));

        success(all);
    });
}

select(id:number, success)
{
    let item = {};
    for(var col of this.columns)
    {
        this.getLocal("tbl_"+this.table+"_"+col+"_"+id, (data) => 
        {
            item[col] = data;
        });
    }
    success(item);
}

private getLocal(key:string, success)
{
    this.local.get(key).then((item) =>
    {
        console.log("Getting : " + key);
        success(item);
    });
}

But I’m in trouble because of asynchrony, my repeat structure is being terminated before you have the result, taking in the console the following information:

database.ts:105 [{},{},{}]
daocontas.ts:95 All itens displayed
database.ts:129 Getting : tbl_acc_id_1
database.ts:129 Getting : tbl_acc_description_1
database.ts:129 Getting : tbl_acc_id_2
database.ts:129 Getting : tbl_acc_description_2
database.ts:129 Getting : tbl_acc_id_3
database.ts:129 Getting : tbl_acc_description_3