I am a beginner in angularjs. I want to dynamically add a div while clicking on add icon.I have done some script on this .
HTML part:
<div ng-show="child" class="childDiv" data-ng-repeat="choice in choices track by $index">
<label for="childname" class="childname" >ServerName </label>
<input ng-model="serverinfo.childname" type="text" required="required" placeholder="name"/>
<label for="childname" class="childname" >Fullname</label>
<input ng-model="serverinfo.childfullname" type="text" required="required" placeholder="fullname"/>
<label for="childname" class="childname" >Mandatory Field</label>
<input ng-model="serverinfo.field" type="text" required="required" placeholder="city/county.."/>
<label for="childname" class="childname" >Field values</label>
<input ng-model="serverinfo.value" type="text" required="required" placeholder=""/>
<i ng-click="removechild()" ng-show="$last" style="padding-left:16em;" class="material-icons">remove</i>
</div>
<i ng-click="addchild()" style="padding-left:16em;" class="material-icons">add</i>
JS part:
$scope.addchild = function() {
// $scope.child = true;
var newItemNo = $scope.choices.length+1;
$scope.choices.push({'id':'choice'+newItemNo});
};
$scope.removechild = function() {
var lastItem = $scope.choices.length-1;
$scope.choices.splice(lastItem);
};
My issue is like whatever I input in the textbox, it will automatically copy to the next set. Can anyone figure out the issue.

serverinfo? Shouldn't you bind it tochoice in?$scope.serverinfo. If you want to useserverinfoin the controller then you should useserverinfo[ $index ].yourPropertyNameinstead - This will give you an array where the properties of the elements in the$scope.serverinfoarray match the choices in$scope.choicesrespectively