Now there are two arrays. The id value in array test1 corresponds to the value in test2. So now we want to implement, if the test1 id value = the id value in test2.idnum, put the id value in test2.idnum The number corresponding to the id value is output to the p tag. How do I do this matching and write the value into the p tag? Can this be done using filter?
html:
<p ng-repeat="td in test1">
<p id="{{td.id}}">
<p>该id对应的数值是:{{...}}<p>
</p>
</p>
First array
$scopt.test1=[{
"id": "x01",
"imgurl": "images/banner_01.jpg",
"status": "0"
},
{
"id": "x02",
"imgurl": "images/banner_01.jpg",
"status": "0"
},
{
"id": "x03",
"imgurl": "images/banner_01.jpg",
"status": "0"
}]
Second array
$scopt.test2=[{"dco":"xsadsq112341",
"reqs":"yes",
"idnum":{"x01":"1","x02":"3","x03":"0"}]
I wonder if this is the case?
Filter can
ng-if can also be used