JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myApp" ng-controller="myCtrl">
A_Number:
<input type="number" step="1" ng-model="A_Number">
<br> Display (A_Number): {{A_Number}}
<br> square: {{square}}
</div>
JavaScript
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.square = 0;
$scope.$watch('A_Number', function(newValue, oldValue) {
{
if (!isNaN(newValue)) {
$scope.square = $scope.A_Number * $scope.A_Number;
}
}
});
});