使用变量从数组中获取密钥

时间:2017-06-15 13:43:45

标签: angularjs object ionic2

makeList(){
    this.list = Object.keys(this.soa);

    this.list.forEach(key => {
        this.soa.value.push(this.soa.key)

    });
    console.log(this.list);
    console.log(this.soa.value);


}

Object soa看起来像这样:

{soaNaam:"Syfilis", soaTijd:"Test 2",soaSymp : "Symptomen",soaDia : "Diagnostiek",soaBeh: "Behandeling",soaNa : "Nacontrole",soaPar : "Partnerwaarschuwing"}

给出一些上下文我试图将每个键的值推入对象soa中的数组

我需要这个用于* NgFor,如果有人知道在ngRepeat中使用functionallity显示它的方法很棒!

编辑:我的意思是* Ng不再重复,很抱歉

1 个答案:

答案 0 :(得分:0)

test1: 0.0492231889643
test2: 0.0587620022106
test3: 0.123777403419
test4: 12.6396287782

看起来像这样?