Answer the question
In order to leave comments, you need to log in
The simplest question on Angular?
Hello. Started learning Angular. It is not possible to output the value of the input to the res expression through the controller. There is no output. And How can I add the value of ng-model digits from different inputs?
<script>
var moduleCalc=angular.module('moduleCalc', []);
moduleCalc.controller('calcCtrl', function($scope){
$scope.res=$scope.first;
});
</script>
</head>
<body ng-controller="calcCtrl">
<input type="text" name="ss" class="form-control" value="ddd" pattern="" title="" ng-model="first">
{{res}}
</body>
Answer the question
In order to leave comments, you need to log in
But it works)) Do you understand why? :
controller:
var TestApp = angular.module("TestApp", []);
function TestCtrl($scope) {
$scope.t1 = {name:'vasya'};
$scope.t2 = $scope.t1;
}
t1- {{t1.name}}<br><br>
<input type='text' ng-model='t1.name'><br>
t2- {{t2.name}}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question