Below is a snippet of HTML code from my AngularJS application
<input type="text" class="input-xlarge" id="user_name" ng-model="myModel.text"
name="user_name" rel="popover" data-content="Enter your first and last name."
data-original-title="Full Name">
<input type="text" class="input-xlarge" id="user_email" ng-model="myModel.text"
name="user_email" rel="popover" data-content="What’s your email address?"
data-original-title="Email">
This is the controller code being used
function MyCtrl2($scope) {
var initial = {text1: 'initial value'};
var ini = {text2: 'initialvalue'};
$scope.myModel = angular.copy(initial);
$scope.myModel = angular.copy(ini);
}
MyCtrl2.$inject = ['$scope'];
When typing in the first text box, the content gets automatically populated in the second text box as well.
I'm trying to understand why this is happening and how to prevent it.