Example $watch() Method

With the 'immediate' option set to 'true' the watcher is also triggered right after it is created.

Current value: 4

Messages from the watcher:

  1. Old value: undefined New value: 4