Imagine two different sections in an HTML file:
<div class="divArea1" ng-controller="myController">
<input ng-click="updateName()" type="button" value="Change Name"/>
</div>
<div class="divArea1" ng-controller="myController">
<p>{{name}}</p>
</div>
Check out this example using AngularJS:
productApp.controller("myController", [ '$scope', function($scope) {
$scope.name= "XYZ";
$scope.updateName= function() {
$scope.name = "ABC";
};
} ]);
The issue arises when attempting to update the name - after clicking the button, the change is not reflected in the second div area. What could be causing this problem?