 <p>I would keep that logic out of the HTML and in your controller if possible and add another function to set a new value in your view (either num1 * num2 or "Please enter a number"). </p> <pre><code>$scope.isFinite = function(num1, num2) { //Your logic for this function } $scope.checkFinite() { $scope.answer = null; if($scope.isFinite($scope.num1, $scope.num2)) { $scope.answer = $scope.num1 * $scope.num2; }; else { $scope.answer = "Please enter a number" }; } </code></pre> <p>Then update your html as so: <code>&lt;p&gt;Your total value is {{answer}} &lt;/p&gt;</code></p> <p>You will need to run $scope.checkFinite() when your input changes, there are a couple of ways you can do that:</p> <pre><code>&lt;div ng-app = ""&gt; &lt;p&gt;Enter variable 1: &lt;input type = "number" ng-change="checkFinite()" ng-model = "var1"&gt;&lt;/p&gt; &lt;p&gt;Enter variable 2: &lt;input type ="number" ng-change="checkFinite()" ng-model ="var2"&gt;&lt;/p&gt; </code></pre> <p>Basically, if the values change in the inputs, it will run $scope.checkFinite(), its a nifty little directive in Angular.</p> <p>Another way you can do this, where you run the function ($scope.checkFinite()) when either inputs change is through a couple of watches in your controller:</p> <pre><code>$scope.$watch('num1', function() { $scope.checkFinite(); }); $scope.$watch('num2', function() { $scope.checkFinite(); }); </code></pre> <p>Let me know if you have any other questions!</p> <p>PS Don't go crazy with $scope.$watch, it's easy to fall into that trap.</p>