我使用angular CLI 6和angularfirebase 2。
我的组件中有很多耐心的PPS数据。我想通过他们自己的Firebase密钥删除每个PPS,但是在这里我删除了应用程序的所有PPS。谁能说我怎么了?谢谢!
Component.ts ngOnInit(){
this.route.params.forEach((urlParameters) => {
this.patientid = urlParameters['id'];});
this.ppssToDisplay = this.ppssService.getPPSByPatientid(this.patientid);
removePPS(this): void { this.ppssService.deletePPS(this.key)};
Component.thml
<button mat-icon-button (click)="removePPS()"><mat-icon class="example-icon">delete </mat-icon></button>
</div>
Service.ts
getPPSByPatientid(Patientid: string){
return this.database.list('/ppss', ref => ref.orderByChild("Patientid").equalTo(Patientid)).valueChanges();
}
deletePPS(key: string){
return this.ppss.remove(key);
}