How to use $watch() function in angularjs with example