I'm trying to get into Angular after a few months without programming and have decided to code a cascading dropdown menu. I was trying to do the second part of the cascade and my code was looking like this:
onSelect(event_type:any){
this.dropdownListService.getAll().subscribe((res:any)=>{
this.properties = res['properties'].filter((res:any) => res.event_type == event_type!.value),
console.log(this.properties);
})
}
The only problem is that I'm getting
"ERROR TypeError: Cannot read properties of undefined (reading 'filter')"
I can't understand, why is it undefined?