I want to use angular to make an automatic adder, the code is as follows
<input type="text" ng-model="add1">
<input type="text" ng-model="add2">
<p>total={{add1+add2}}</p>
This code simply connects strings. I tried to use parseInt(add1) parseInt(add2) but it didn’t work. I don’t know if Angular has any method to convert characters into numerical values.
You can add the corresponding function in $scope
Then you can use it