$watch in angularjs code example Example: $scope.$apply $scope.$apply(function () { // Add $scope.myVariableHere = value });