I have an array $scope.multiRoles , I need to remove the values inside it by clicking remove button. And the removed value should moved to another array $scope.role. I am able to remove the array by calling removeRole() but couldn't move the removed values into another array. Need assistance.
Html:
<div ng-if="rolesAdded" class = "col-sm-12 col-xs-12">
<span class="tag label tagStyle newStyling" value ="data" ng-repeat="data in multiRoles track by $index">
<span>{{data}}</span>
<a><i ng-click="removeRoles(index)"class="remove glyphicon glyphicon-remove-sign "></i></a>
</span>
</div>
JS:
$scope.removeRoles = function(index){
if(($scope.multiRoles!== null ) && ($scope.multiRoles.length>1)) {
$scope.multiRoles.splice(index,1);
}
$scope.rolesAdded = true;
};