AngularJS: Watching for changes in ng-model and determine linked DOM element

Sometimes you want to watch for changes on your model within AngularJS and trigger an event if a model change occurs. For example, I needed to trigger a change event on the corresponding HTML DOM element whenever the model linked to the element changed. Here’s how to do it – using a $watch listener and a directive. Continue reading AngularJS: Watching for changes in ng-model and determine linked DOM element