AngularJS array filtering according to another array -
suppose have array of objects:
data = [{id:1, name="a"}, {id:2, name="b"}, {id:3, name="c"}, ....] and have 2 arrays:
selecteddata = [{id:1, name="a"}, {id:3, name="c"}] and
selecteddataids = [1,3] i want these 2 arrays bound each other.
e.g. when
selecteddataids = [1] then
selecteddata = [{id:1, name="a"}] and vice versa.
you put both of arrays service , control update of arrays through method calls. check out plunkr here. it's cursory attempt think use starting point.
Comments
Post a Comment