So, I have an observable type Student []. That is, an observable array of objects. The student has a property id: number. How can I filter the indexes of an array of students based on a property. For example, let's say that $ students are observed as type Observable [Student], and I would like to remove the student from Observable<Student[]>based on my "bannedId", I tried:
students$.filter(student => student.id !== bannedId)
however, I got an error that id is not a property of Student []. If I put an index, i.e. student[0].id, it recognizes the property, but obviously will not do what I want. How can I filter this?
source
share