I'm facing an issue with removing the value of a dropdown from the table component to the ooptymodel component. Even after using input and output decorators, the solution doesn't seem to work. Can someone guide me on how to successfully remove the dropdown value from the table component? I am not familiar with utilizing a service to resolve this problem. Any help in finding a solution would be greatly appreciated.
Table Component:
export class TableComponent implements OnInit {
@Input() names: any = [];
@Output() deletedName: EventEmitter<string> = new EventEmitter();
constructor() {}
ngOnInit() {}
onRemove(name: string) {
this.names = this.names.filter((x) => x !== name);
this.deletedName.emit(name);
}
}
Ooptymodel Component:
export class OoptymodelComponent implements OnInit {
dpData: string[] = [
'Maverick',
'Stanislav',
'Arxero',
'Feruchio',
'Mavericus',
'Arxiour',
];
deletedName: string;
constructor() {}
ngOnInit() {}
onDeletedName(name: string) {
this.deletedName = name;
}
}