javascript - How to watch whole array of objects? -
this question has answer here:
i have array of ten objects. each 1 of them contains 6 properties , display on view. user able change properties typing new data on inputs. how can watch whole array , identify property on object has been changed , don't repeat code 10 times in order watch each object separately?
you can use $watchcollection
$scope.$watchcollection('data', function (newval, oldval) { /*...*/ });
Comments
Post a Comment