search

Home  >  Q&A  >  body text

Angular.js custom directives

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!

天蓬老师天蓬老师2816 days ago550

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-05-15 16:55:51

    1. Do you mean the string corresponding to list.sort数组里面的数字,转换成sort.id? If so, you can take a look at a demo I wrote.

    reply
    0
  • Cancelreply