Answer the question
In order to leave comments, you need to log in
How to do this in AngularJS?
AngularJS is just learning, so don't kick me.
There is such code - jsfiddle.net/tctkopre/1
<script>
var app = angular.module('foo', [])
app.controller('userCtrl', function ($scope) {
$scope.first = 1;
$scope.two = 2;
$scope.tree = $scope.first + $scope.two;
});
</script>
<div ng-controller="userCtrl">
<input ng-model="first" type="number" />
<input ng-model="two" type="number" />
<h1>{{tree}}</h1>
</div>
$scope.tree = $scope.first + $scope.two;
<script>
var app = angular.module('foo', []);
app.controller('userCtrl', function ($scope) {
$scope.sum = $scope.range1 + $scope.range2;
});
</script>
<div ng-controller="userCtrl">
<input ng-model="range1" type="range" value="10" />
<input ng-model="range2" type="range" value="10" />
<h1>{{sum}}</h1>
</div>
Answer the question
In order to leave comments, you need to log in
<div ng-controller="userCtrl">
<input ng-model="first" type="number" />
<input ng-model="two" type="number" />
<h1>{{ first + two }}</h1>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question