I have a very weird problem with AngularJS 1.4 (TypeScript). The problem is in the controller I have a variable and this value can be viewed in an input text box. However, when I edit the value in this text box and click on a button, the value of this variable doesn't change(!).
HTML view
<div class="form-group">
<label>Title</label>
<input class="form-control" ng-model="serviceTitle">
</div>
<div class="form-group">
<button class="btn btn-primary" ng-click="updateServiceIdentification()">Update Service Identifcation</button>
</div>
Controller:
$scope.serviceTitle = "Test";
$scope.updateServiceIdentification = ()=> {
// after changing value in view, the value here is still "Test"????
alert($scope.serviceTitle);
}
If I add a test label in HTML view
<h1>{{serviceTitle}}</h1>
when I change the value of the input text box, the new value can be printed in this label.