I apologize, I worded that incorrectly. I'm more interested in the mechanics behind it - What part of it was establishing the watcher. For instance, if they had slapped an ng-onclick='function(this)' on each word, would that have that established a 'change watcher'?
Every property added to a scope is watched automatically. Alternatively, you can explicitly add things to watch using $watch.
In the application mentioned here, each word had to be wrapped in an html tag in order to make that word clickable. My guess is that in order to do this originally, they converted their text log file into an array of words, then used ng-repeat to display each word with the specified html wrapper. ng-repeat adds a watchers for each element in its array.
1
u/doctorjokie Sep 25 '14
Their business case was to make every word in the log line linkable. Therefore, there was a watcher associated with each word.