I just started learning Angular.js, please give me some advice!
The question is as follows:
{
sort:[
{id:1,text:"A"},
{id:2,text:"B"},
{id:3,text:"C"}
],
list:[
{id:1,text:"AA",sort:[1,2]},
{id:2,text:"BB",sort:[1,2]},
{id:3,text:"CC",sort:[2,2]}
]
}
After looping through the list, I hope to write an instruction to convert list.sort
The elements of list.sort correspond to sort.id
Ask for the method code!
1. Do you mean the string corresponding to
list.sort
数组里面的数字,转换成sort.id
? If so, you can take a look at a demo I wrote.