How can I transfer selected items to another list, in order to manipulate the final object/array later on?
student.component.ts:
students= [];
studentsFinal = [];
onGetStudents() {
this.studentService.getStudents()
.subscribe(
(students: any[]) => this.students = students,
(error) => console.log(error),
);
}
student.component.html:
<h5>Final list of students</h5>
<div class="col-xs-6">
<select name="multiselect1" multiple class="form-control" name="myselecttsms1">
<option *ngFor="let studentFinal of studentsFinal" value="{{ studentFinal.Id }}">{{ studentFinal.Name }}</option>
</select>
<br>
</div>
<h5>Students</h5>
<div class="col-xs-6">
<select name="multiselect2" multiple class="form-control" name="myselecttsms2">
<option *ngFor="let student of students" value="{{ student.Id }}">{{ student.Name }}</option>
</select>
<br>
</div>