I'm currently working on an Angular 4 project and I need to be able to delete a row from Firebase when it's clicked.
Here is the code for my smart table:
<ng2-smart-table [settings]="settings" [source]="source" (edit)="onEdit($event)" (delete)="onDelete($event)">
</ng2-smart-table>
The onDelete() function looks like this:
onDelete(event) {
console.log(event);
if (window.confirm('Are you sure you want to delete?')) {
this.service.deleteEnquiry(event.data);
} else {
event.confirm.reject();
}
}
I've implemented the deleteEnquiry function in the service as shown below:
deleteEnquiry(data){
console.log(data);
this.af.list('/enquirydata/').remove(data);
}
However, I'm encountering an issue where it's not working and displaying the following error in the console:
ERROR Error: Expects a string, snapshot, or reference.
Can anyone offer some assistance?