Open rksingh1999 opened 4 years ago
Please check this bug so that can fix my error in my project. In my project ,Testimonial components in which it works fine but in this the same code for delete the activity it will delete the content only .
this is screan short of the inspection you can see in the screan short whien we delete the object it delete content only not the object
clickToDelete() method clickToDelete(activityId: string){ this.activityService.deleteActivity(activityId).subscribe(act=>{ this.getActivities(); this.deleteInfo= true; this.dataSaved= false; }); }
getAllActivities() method getActivities(){ this.activityService.getAllActivity().subscribe((data: Activity[] )=>{ this.activities = data; console.log(this.activities); }); } CMS cervice class /getAllactivity method getAllActivity():Observable<Activity[]>{ return this.http.get<Activity[]>(this.activityUrl); } this is delete method which is in CMS service deleteActivity(activityId: string):Observable{
let httpHeaders = new HttpHeaders().set('Content-type','application/json');
let options={
headers:httpHeaders
};
return this.http.delete(this.activityUrl+"/"+activityId);
}
Service Class
Activity.ts
![Screenshot (444)](https://user-images.githubusercontent.com/42120881/71612561-412a5100-2bc7-11ea-8ff5-04a2d5a9154e.png)