var HelloCtrl = function($scope) { $scope.$watch(function () { return Math.random(); }); };
<div ng-app ng-controller="HelloCtrl"> <label>Name:</label> <input type="text" ng-model="yourName" placeholder="Enter a name here" /> <hr/> <h1>Hello {{yourName}}!</h1> </div>