I want to access particular json in ngOninit. So i have id on click in edit button and with the help of that id i am getting complete object from database like form name , f
Don't subscribe inside service, subscribe inside component onInit.
GetFormById (id: number) {
return this.httpClient.get(this.API_URL + "GetFormTemplate/" + id);
}
ngOnInit() {
const id = this.route.snapshot.paramMap.get('id');
this.dataService.GetFormById(+id).subscribe(data => {
console.log(data);
})
}