My addition calculator has a simple layout as shown below:
<!DOCTYPE html>
<html ng-app>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js">
</script>
</head>
<body>
<input type="number" ng-model="input1" /> + <input type="number" ng-model="input2" /> = <input type="number" ng-model="input1 + input2" />
</body>
</html>
An example calculation would be: 2 + 3 = 5
Now, I have a new requirement to allow editing in the third input field. When this value changes, it should update the first input dynamically so that the numbers add up correctly. For instance, changing 5 to 6 should result in the following:
3 + 3 = 6
The challenge is that the model of the third input is a calculation which prevents direct editing. I need advice on how to make all three inputs editable while maintaining the required calculation functionality.