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

Popular posts from this blog

python - RuntimeError: can't re-enter readline -

python - PyInstaller UAC not working in onefile mode -

php - Need to store a large amount of data in session with CI 3 but on storing large data in session it is itself destorying automatically -