skip to Main Content

Javascript – how to build one to one relation between two array in angular

student:any=[{name:'shariful', id:'1',teacherId:'1'},{name:'Hasan', id:'2',teacherId:'2'},{name:'sohag', id:'3',teacherId:'2'}] teacher:any=[{name:'Robi',id:'1'},{name:'Aktarujaman',id:'2'}] needResult:any=[{name:'shariful', id:'1',teacherId:1,teacherName:'Robi'},{name:'Hasan', id:'2',teacherId:'2',teacherName:'Aktarujaman'},{name:'sohag', id:'3',teacherId:'1',teacherName:'Robi'}] I need to join student and teacher . the output is as like as needResult . Need to join in my angular project

VIEW QUESTION

How to fix ‘Object is possibly null’ error in Angular/TypeScript?

<div class="container"> <div class="row"> <section class="col-3"> <h5 class="text-warning ml-3">Sort</h5> <select class="custom-select mb-3" (change)="onSortSelected($event.target.value)"> <option *ngFor="let sort of sortOptions" [value] = "sort.value">{{sort.name}}</option> </select> I am getting the following error in the ($event.target.value) part value throws an error : Angular error TS2531:…

VIEW QUESTION
Back To Top
Search